Skip to content

Commit 61b4ffd

Browse files
committed
HHH-18961 JtaIsolationDelegate, obtaining connection : NPE when SQLExceptionConversionDelegate#convert returns null
1 parent f8d1a1c commit 61b4ffd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaIsolationDelegate.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ private <T> T doTheWork(WorkExecutorVisitable<T> work) {
203203
}
204204
}
205205
catch (SQLException e) {
206-
throw sqlExceptionConverter().apply( e, "unable to obtain isolated JDBC connection" );
206+
final JDBCException jdbcException = sqlExceptionConverter().apply( e, "unable to obtain isolated JDBC connection" );
207+
if ( jdbcException == null ) {
208+
throw new HibernateException( "Unable to obtain isolated JDBC connection", e );
209+
}
210+
throw jdbcException;
207211
}
208212
}
209213

0 commit comments

Comments
 (0)