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:
@@ -430,7 +430,7 @@ public abstract class SharedEntityManagerCreator {
|
|||||||
entry.setValue(storedProc.getOutputParameterValue(key.toString()));
|
entry.setValue(storedProc.getOutputParameterValue(key.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex) {
|
catch (RuntimeException ex) {
|
||||||
entry.setValue(ex);
|
entry.setValue(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user