mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 16:44:57 +00:00
HHH-9685 - Envers should do nothing when JTA transaction is already marked as rollback-only
(cherry picked from commit a6f3319eafddf0aa0b9629de7eba79b11eedc760)
This commit is contained in:
parent
3305c71fbc
commit
b2c9724905
@ -20,10 +20,14 @@
|
||||
import org.hibernate.envers.internal.synchronization.work.AuditWorkUnit;
|
||||
import org.hibernate.envers.tools.Pair;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
*/
|
||||
public class AuditProcess implements BeforeTransactionCompletionProcess {
|
||||
private static final Logger log = Logger.getLogger( AuditProcess.class );
|
||||
|
||||
private final RevisionInfoGenerator revisionInfoGenerator;
|
||||
private final SessionImplementor session;
|
||||
|
||||
@ -124,6 +128,11 @@ public void doBeforeTransactionCompletion(SessionImplementor session) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !session.getTransactionCoordinator().isActive() ) {
|
||||
log.debug( "Skipping envers transaction hook due to non-active (most likely marked-rollback-only) transaction" );
|
||||
return;
|
||||
}
|
||||
|
||||
// see: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178431
|
||||
if ( FlushMode.isManualFlushMode( session.getFlushMode() ) ) {
|
||||
Session temporarySession = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user