File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2020import org .hibernate .envers .internal .synchronization .work .AuditWorkUnit ;
2121import org .hibernate .envers .tools .Pair ;
2222
23+ import org .jboss .logging .Logger ;
24+
2325/**
2426 * @author Adam Warski (adam at warski dot org)
2527 */
2628public class AuditProcess implements BeforeTransactionCompletionProcess {
29+ private static final Logger log = Logger .getLogger ( AuditProcess .class );
30+
2731 private final RevisionInfoGenerator revisionInfoGenerator ;
2832 private final SessionImplementor session ;
2933
@@ -124,6 +128,11 @@ public void doBeforeTransactionCompletion(SessionImplementor session) {
124128 return ;
125129 }
126130
131+ if ( !session .getTransactionCoordinator ().isActive () ) {
132+ log .debug ( "Skipping envers transaction hook due to non-active (most likely marked-rollback-only) transaction" );
133+ return ;
134+ }
135+
127136 // see: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178431
128137 if ( FlushMode .isManualFlushMode ( session .getFlushMode () ) ) {
129138 Session temporarySession = null ;
You can’t perform that action at this time.
0 commit comments