[hibernate-dev] Statements leaks when using JPA StoredProcedureQuery API

Steve Ebersole steve at hibernate.org
Mon Oct 16 10:13:44 EDT 2017


On Mon, Oct 16, 2017 at 9:00 AM Robert Marcano <robert at marcanoonline.com>
wrote:

> No, I know implicitly closing the JDBC statement is not possible with
> only the current CallableStatement API. There is no way to know if the
> client code needs or read all possible outputs from the stored
> procedure. My previous email mentioned making CallableStatement an
> AutoCloseable but that will make the API too different from the other
> kind of queries, that you explained better than me, are stateless.
>
> Maybe exposing Hibernate ProcedureOutputs to JPA or StoredProcedureQuery
> implementing some kind of prepareCall() method that return a stateful
> object that implement AutoCloseable.
>

"Exposing Hibernate ProcedureOutputs to JPA" how?  Something beyond the
`storedProcedureQuery.unwrap( ProcedureOutputs.class )` I mentioned earlier?


More information about the hibernate-dev mailing list