From b14e69089fa8f6eb26599873e462338fa7f00fa7 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Fri, 11 Nov 2016 16:40:51 +0000 Subject: [PATCH] HHH-11232 - Session is closed bug with Envers 5.2.x + JTA --- .../hibernate/envers/internal/synchronization/AuditProcess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization/AuditProcess.java b/hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization/AuditProcess.java index 52a7dc112d..59542447d1 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization/AuditProcess.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization/AuditProcess.java @@ -134,7 +134,7 @@ public class AuditProcess implements BeforeTransactionCompletionProcess { } // see: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178431 - if ( FlushModeType.COMMIT.equals( session.getFlushMode() ) ) { + if ( FlushModeType.COMMIT.equals( session.getFlushMode() ) || session.isClosed() ) { Session temporarySession = null; try { temporarySession = session.sessionWithOptions()