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
This commit is contained in:
Giuseppe
2023-03-22 10:21:03 +00:00
committed by Sam Brannen
parent ae70bf7c38
commit 24b359d519

View File

@@ -430,7 +430,7 @@ public abstract class SharedEntityManagerCreator {
entry.setValue(storedProc.getOutputParameterValue(key.toString()));
}
}
catch (IllegalArgumentException ex) {
catch (RuntimeException ex) {
entry.setValue(ex);
}
}