Skip to content

Commit 24b359d

Browse files
giuseppemiliciasbrannen
authored andcommitted
Handle all exceptions for stored proc out param retrieval in SharedEntityManagerCreator
Prior to this commit, the EntityManager was not closed in SharedEntityManagerCreator.DeferredQueryInvocationHandler's invoke(Object, Method, Object[]) method if an invocation of getOutputParameterValue(*) threw an exception other than IllegalArgumentException, which could lead to a connection leak. This commit addresses this by catching RuntimeException instead of IllegalArgumentException. Closes gh-30161
1 parent ae70bf7 commit 24b359d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ else if (targetClass.isInstance(proxy)) {
430430
entry.setValue(storedProc.getOutputParameterValue(key.toString()));
431431
}
432432
}
433-
catch (IllegalArgumentException ex) {
433+
catch (RuntimeException ex) {
434434
entry.setValue(ex);
435435
}
436436
}

0 commit comments

Comments
 (0)