HHH-11407 - JPA + JDBC transaction - when a commit fails rollback is executed twice

This commit is contained in:
Andrea Boriero 2017-01-18 21:35:08 +00:00
parent c9df1a9981
commit 33ae0b3b9e
1 changed files with 9 additions and 7 deletions

View File

@ -250,14 +250,16 @@ public class JdbcResourceLocalTransactionCoordinatorImpl implements TransactionC
@Override
public void markRollbackOnly() {
if ( log.isDebugEnabled() ) {
log.debug(
"JDBC transaction marked for rollback-only (exception provided for stack trace)",
new Exception( "exception just for purpose of providing stack trace" )
);
}
if ( getStatus() != TransactionStatus.ROLLED_BACK && getStatus() != TransactionStatus.NOT_ACTIVE ) {
if ( log.isDebugEnabled() ) {
log.debug(
"JDBC transaction marked for rollback-only (exception provided for stack trace)",
new Exception( "exception just for purpose of providing stack trace" )
);
}
rollbackOnly = true;
rollbackOnly = true;
}
}
}
}