ProcedureCall should implement AutoCloseable

Description

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.

Environment

None

Activity

Show:
Vlad Mihalcea
February 14, 2019, 12:37 PM

I think this one should be backported to 5.x as the current workaround is both verbose and unintuitive.

Fixed

Assignee

Vlad Mihalcea

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major