diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java index 939b223fef..0fe30e137b 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -77,8 +77,6 @@ import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; import org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy; import org.hibernate.cache.spi.access.RegionAccessStrategy; -import org.hibernate.cfg.AvailableSettings; -import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.cfg.Settings; import org.hibernate.cfg.SettingsFactory; @@ -1718,7 +1716,8 @@ public final class SessionFactoryImpl @Override public StatelessSession openStatelessSession() { - return new StatelessSessionImpl( connection, tenantIdentifier, sessionFactory, sessionFactory.settings.getRegionFactory().nextTimestamp() ); + return new StatelessSessionImpl( connection, tenantIdentifier, sessionFactory, + sessionFactory.settings.getRegionFactory().nextTimestamp() ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java index 1ac632d00f..f45662acb7 100755 --- a/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java @@ -84,8 +84,19 @@ public class StatelessSessionImpl extends AbstractSessionImpl implements Statele private TransactionCoordinator transactionCoordinator; private PersistenceContext temporaryPersistenceContext = new StatefulPersistenceContext( this ); private long timestamp; + + StatelessSessionImpl( + Connection connection, + String tenantIdentifier, + SessionFactoryImpl factory) { + this( connection, tenantIdentifier, factory, factory.getSettings().getRegionFactory().nextTimestamp() ); + } - StatelessSessionImpl(Connection connection, String tenantIdentifier, SessionFactoryImpl factory, long timestamp) { + StatelessSessionImpl( + Connection connection, + String tenantIdentifier, + SessionFactoryImpl factory, + long timestamp) { super( factory, tenantIdentifier ); this.transactionCoordinator = new TransactionCoordinatorImpl( connection, this ); this.timestamp = timestamp;