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 20
20
import org .hibernate .envers .internal .synchronization .work .AuditWorkUnit ;
21
21
import org .hibernate .envers .tools .Pair ;
22
22
23
+ import org .jboss .logging .Logger ;
24
+
23
25
/**
24
26
* @author Adam Warski (adam at warski dot org)
25
27
*/
26
28
public class AuditProcess implements BeforeTransactionCompletionProcess {
29
+ private static final Logger log = Logger .getLogger ( AuditProcess .class );
30
+
27
31
private final RevisionInfoGenerator revisionInfoGenerator ;
28
32
private final SessionImplementor session ;
29
33
@@ -124,6 +128,11 @@ public void doBeforeTransactionCompletion(SessionImplementor session) {
124
128
return ;
125
129
}
126
130
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
+
127
136
// see: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178431
128
137
if ( FlushMode .isManualFlushMode ( session .getFlushMode () ) ) {
129
138
Session temporarySession = null ;
You can’t perform that action at this time.
0 commit comments