It's not obvious for Hibernate users that both ProcedureCall and the JPA StoredProcedureQuery are leaking the underlying CallableStatement which only gets closed at transaction commit/rollback time. Without making this ore obvious, many devs will bump into this issue described here and face ORA-01000 issues. I think we should make the ProcedureCall implement the AutoCloseable interface so that we can also use it with JPA StoredProcedureQuery via unwrapping. This issue should also explain the behavior in the User Guide. |