File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
hibernate-testing/src/main/java/org/hibernate/testing/jta Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -93,9 +93,14 @@ public Connection getConnection() throws SQLException {
9393 if ( connection == null ) {
9494 connection = delegate .getConnection ();
9595 TestingJtaPlatformImpl .synchronizationRegistry ().putResource ( CONNECTION_KEY , connection );
96-
97- XAResourceWrapper xaResourceWrapper = new XAResourceWrapper ( this , connection );
98- currentTransaction .enlistResource ( xaResourceWrapper );
96+ try {
97+ XAResourceWrapper xaResourceWrapper = new XAResourceWrapper ( this , connection );
98+ currentTransaction .enlistResource ( xaResourceWrapper );
99+ }
100+ catch (Exception e ) {
101+ delist ( connection );
102+ throw e ;
103+ }
99104 }
100105 return connection ;
101106 }
You can’t perform that action at this time.
0 commit comments