File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
hibernate-core/src/main/java/org/hibernate/resource/jdbc/internal Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -215,11 +215,15 @@ private void releaseConnection() {
215215 " This might indicate a multi-threaded use of Hibernate in combination with managed resources, which is not supported." );
216216 }
217217 try {
218- getResourceRegistry ().releaseResources ();
219- if ( ! localVariableConnection .isClosed () ) {
220- sqlExceptionHelper .logAndClearWarnings ( localVariableConnection );
218+ try {
219+ getResourceRegistry ().releaseResources ();
220+ if ( !localVariableConnection .isClosed () ) {
221+ sqlExceptionHelper .logAndClearWarnings ( localVariableConnection );
222+ }
223+ }
224+ finally {
225+ jdbcConnectionAccess .releaseConnection ( localVariableConnection );
221226 }
222- jdbcConnectionAccess .releaseConnection ( localVariableConnection );
223227 }
224228 catch (SQLException e ) {
225229 throw sqlExceptionHelper .convert ( e , "Unable to release JDBC Connection" );
You can’t perform that action at this time.
0 commit comments