DataSourceTransactionManager resets ConnectionHolder on doBegin failure

Issue: SPR-12280
This commit is contained in:
Juergen Hoeller 2014-10-02 14:33:21 +02:00
parent 05c995cfb3
commit fd69ee541e
1 changed files with 5 additions and 2 deletions

View File

@ -238,7 +238,10 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
} }
catch (Throwable ex) { catch (Throwable ex) {
if (txObject.isNewConnectionHolder()) {
DataSourceUtils.releaseConnection(con, this.dataSource); DataSourceUtils.releaseConnection(con, this.dataSource);
txObject.setConnectionHolder(null, false);
}
throw new CannotCreateTransactionException("Could not open JDBC Connection for transaction", ex); throw new CannotCreateTransactionException("Could not open JDBC Connection for transaction", ex);
} }
} }