Revert "HHH-13997 Use functions for the creation of ActionQueue and PersistenceContext"
This reverts commit 00acb1f213
.
This commit is contained in:
parent
00acb1f213
commit
e28d77ac33
|
@ -28,7 +28,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import javax.persistence.CacheRetrieveMode;
|
import javax.persistence.CacheRetrieveMode;
|
||||||
import javax.persistence.CacheStoreMode;
|
import javax.persistence.CacheStoreMode;
|
||||||
|
@ -220,17 +219,10 @@ public class SessionImpl
|
||||||
private transient GraphImplementor fetchGraphLoadContext;
|
private transient GraphImplementor fetchGraphLoadContext;
|
||||||
|
|
||||||
public SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options) {
|
public SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options) {
|
||||||
this( factory, options, StatefulPersistenceContext::new, ActionQueue::new );
|
|
||||||
}
|
|
||||||
|
|
||||||
public SessionImpl(
|
|
||||||
SessionFactoryImpl factory, SessionCreationOptions options,
|
|
||||||
Function<SharedSessionContractImplementor, StatefulPersistenceContext> persistenceContextFunction,
|
|
||||||
Function<SessionImplementor, ActionQueue> actionQueueFunction) {
|
|
||||||
super( factory, options );
|
super( factory, options );
|
||||||
|
|
||||||
this.persistenceContext = persistenceContextFunction.apply( this );
|
this.persistenceContext = createPersistenceContext();
|
||||||
this.actionQueue = actionQueueFunction.apply( this );
|
this.actionQueue = createActionQueue();
|
||||||
|
|
||||||
this.autoClear = options.shouldAutoClear();
|
this.autoClear = options.shouldAutoClear();
|
||||||
this.autoClose = options.shouldAutoClose();
|
this.autoClose = options.shouldAutoClose();
|
||||||
|
@ -277,6 +269,14 @@ public class SessionImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected StatefulPersistenceContext createPersistenceContext() {
|
||||||
|
return new StatefulPersistenceContext( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ActionQueue createActionQueue() {
|
||||||
|
return new ActionQueue( this );
|
||||||
|
}
|
||||||
|
|
||||||
private LockOptions getLockOptionsForRead() {
|
private LockOptions getLockOptionsForRead() {
|
||||||
return this.lockOptions == null ? fastSessionServices.defaultLockOptions : this.lockOptions;
|
return this.lockOptions == null ? fastSessionServices.defaultLockOptions : this.lockOptions;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue