diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java index bfa7234fe8..df6184cb90 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java @@ -131,7 +131,7 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont private transient Boolean useStreamForLobBinding; private transient long timestamp; - private transient Integer jdbcBatchSize; + private Integer jdbcBatchSize; protected transient ExceptionConverter exceptionConverter; @@ -1063,5 +1063,6 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont .buildTransactionCoordinator( jdbcCoordinator, this ); entityNameResolver = new CoordinatingEntityNameResolver( factory, interceptor ); + exceptionConverter = new ExceptionConverterImpl( this ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 41184982f6..e354db822f 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -230,8 +230,8 @@ public final class SessionImpl // todo : (5.2) HEM always initialized this. Is that really needed? private LockOptions lockOptions = new LockOptions(); - private transient boolean autoClear; - private transient boolean autoClose; + private boolean autoClear; + private boolean autoClose; private transient int dontFlushFromFind; private transient boolean disallowOutOfTransactionUpdateOperations; @@ -3888,5 +3888,10 @@ public final class SessionImpl for ( String filterName : loadQueryInfluencers.getEnabledFilterNames() ) { ( (FilterImpl) loadQueryInfluencers.getEnabledFilter( filterName ) ).afterDeserialize( getFactory() ); } + + initializeFromSessionOwner( null ); + + this.disallowOutOfTransactionUpdateOperations = !getFactory().getSessionFactoryOptions().isAllowOutOfTransactionUpdateOperations(); + this.discardOnClose = getFactory().getSessionFactoryOptions().isReleaseResourcesOnCloseEnabled(); } }