Skip to content

Commit

Permalink
Handle all exceptions for stored proc out param retrieval in SharedEn…
Browse files Browse the repository at this point in the history
…tityManagerCreator

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-30164
  • Loading branch information
giuseppemilicia authored and sbrannen committed Mar 22, 2023
1 parent b8c1255 commit a94c50e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ else if (targetClass.isInstance(proxy)) {
entry.setValue(storedProc.getOutputParameterValue(key.toString()));
}
}
catch (IllegalArgumentException ex) {
catch (RuntimeException ex) {
entry.setValue(ex);
}
}
Expand Down

0 comments on commit a94c50e

Please sign in to comment.