Skip to content

Commit f026405

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

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
@@ -200,7 +200,11 @@ private <T> T doTheWork(WorkExecutorVisitable<T> work) {
200200
}
201201
}
202202
catch (SQLException e) {
203-
throw sqlExceptionConverter().apply( e, "unable to obtain isolated JDBC connection" );
203+
final JDBCException jdbcException = sqlExceptionConverter().apply( e, "unable to obtain isolated JDBC connection" );
204+
if ( jdbcException == null ) {
205+
throw new HibernateException( "Unable to obtain isolated JDBC connection", e );
206+
}
207+
throw jdbcException;
204208
}
205209
}
206210

0 commit comments

Comments
 (0)