Skip to content

Commit 720732a

Browse files
committed
HHH-19772 use noSessionInterceptorCreation(), due to change in semantics after HHH-19737
also see HHH-14540
1 parent f0f431f commit 720732a

File tree

1 file changed

+6
-4
lines changed
  • hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization

1 file changed

+6
-4
lines changed

hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization/AuditProcess.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
import org.hibernate.envers.internal.revisioninfo.RevisionInfoGenerator;
1919
import org.hibernate.envers.internal.synchronization.work.AuditWorkUnit;
2020
import org.hibernate.envers.tools.Pair;
21-
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
2221
import org.jboss.logging.Logger;
2322

23+
import static org.hibernate.ConnectionAcquisitionMode.AS_NEEDED;
24+
import static org.hibernate.ConnectionReleaseMode.AFTER_TRANSACTION;
25+
2426
/**
2527
* @author Adam Warski (adam at warski dot org)
2628
* @author Chris Cranford
@@ -148,7 +150,7 @@ public void doBeforeTransactionCompletion(SharedSessionContractImplementor sessi
148150
if ( statelessSession.isClosed() ) {
149151
try (StatelessSessionImplementor temporarySession = (StatelessSessionImplementor) statelessSession.statelessWithOptions()
150152
.connection()
151-
.noInterceptor()
153+
.noSessionInterceptorCreation()
152154
.open()) {
153155
executeInStatelessSession( temporarySession );
154156
}
@@ -163,8 +165,8 @@ else if ( FlushMode.MANUAL.equals( session.getHibernateFlushMode() ) || session.
163165
try (SessionImplementor temporarySession = (SessionImplementor) statefulSession.sessionWithOptions()
164166
.connection()
165167
.autoClose( false )
166-
.connectionHandlingMode( PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION )
167-
.noInterceptor()
168+
.connectionHandling( AS_NEEDED, AFTER_TRANSACTION )
169+
.noSessionInterceptorCreation()
168170
.openSession()) {
169171
executeInSession( temporarySession );
170172
temporarySession.flush();

0 commit comments

Comments
 (0)