HHH-6599 Hibernate mark as rollback even for no transaction requests
This commit is contained in:
parent
71bca205e9
commit
0dbc756093
|
@ -1,5 +1,6 @@
|
|||
# Typically *NIX text editors, by default, append '~' to files on saving to make backups
|
||||
*~
|
||||
.DS_Store
|
||||
|
||||
# Gradle work directory
|
||||
.gradle
|
||||
|
|
|
@ -54,6 +54,7 @@ import javax.transaction.Status;
|
|||
import javax.transaction.Synchronization;
|
||||
import javax.transaction.SystemException;
|
||||
import javax.transaction.TransactionManager;
|
||||
import javax.transaction.Status;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
|
@ -1124,7 +1125,9 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
|
|||
);
|
||||
}
|
||||
try {
|
||||
transactionManager.setRollbackOnly();
|
||||
if ( transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION ) {
|
||||
transactionManager.setRollbackOnly();
|
||||
}
|
||||
}
|
||||
catch ( SystemException e ) {
|
||||
throw new PersistenceException( "Unable to set the JTA transaction as RollbackOnly", e );
|
||||
|
|
Loading…
Reference in New Issue