File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
hibernate-envers/src/main/java/org/hibernate/envers/internal/synchronization Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1818import org .hibernate .envers .internal .revisioninfo .RevisionInfoGenerator ;
1919import org .hibernate .envers .internal .synchronization .work .AuditWorkUnit ;
2020import org .hibernate .envers .tools .Pair ;
21- import org .hibernate .resource .jdbc .spi .PhysicalConnectionHandlingMode ;
2221import 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 ();
You can’t perform that action at this time.
0 commit comments