hibernate/hibernate-orm · error · IllegalStateException
StoredProcedureQuery is closed
Error message
StoredProcedureQuery is closed
What it means
Error "StoredProcedureQuery is closed" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java:1048
checkNotClosed();
if ( outputs == null ) {
outputs = buildOutputs();
}
return outputs;
}
@Override
public void close() {
checkNotClosed();
closed = true;
if ( outputs != null ) {
outputs.release();
}
}
private void checkNotClosed() {
if ( closed ) {
throw new IllegalStateException( "StoredProcedureQuery is closed" );
}
}
private OutputsImpl buildOutputs() {
// todo : going to need a very specialized Loader for this.
// or, might be a good time to look at splitting Loader up into:
// 1) building statement objects
// 2) executing statement objects
// 3) processing result sets
// for now assume there are no resultClasses nor mappings defined
// TOTAL PROOF-OF-CONCEPT!!!!!!
// todo : how to identify calls which should be in the form `{? = call procName...}` ??? (note leading param marker)
// more than likely this will need to be a method on the native API. I can see this as a trigger to
// both: (1) add the `? = ` part and also (2) register a REFCURSOR parameter for DBs (Oracle, PGSQL) that
// need it.
View on GitHub (pinned to fad1729dce)
Solutions
- Call the StoredProcedureQuery methods before close() is invoked.
- Guard usage with isOpen() and reopen a new query from the EntityManager if needed.
When it happens
Trigger: A runtime precondition of the Hibernate API is violated.
Common situations: Occurs when application code or configuration does not satisfy the documented contract of the API being called.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/eefcee15bf294c91.
Report an issue: GitHub.