mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-08 12:14:47 +00:00
Revert "HHH-13997 Use functions for the creation of ActionQueue and PersistenceContext"
This reverts commit 2eae22d1b9d4effc5b4e8157155a4b07b0c9c9bf.
This commit is contained in:
parent
d28f513849
commit
b7f120d98c
@ -28,7 +28,6 @@
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import javax.persistence.CacheRetrieveMode;
|
||||
import javax.persistence.CacheStoreMode;
|
||||
@ -220,17 +219,10 @@ public class SessionImpl
|
||||
private transient GraphImplementor fetchGraphLoadContext;
|
||||
|
||||
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 );
|
||||
|
||||
this.persistenceContext = persistenceContextFunction.apply( this );
|
||||
this.actionQueue = actionQueueFunction.apply( this );
|
||||
this.persistenceContext = createPersistenceContext();
|
||||
this.actionQueue = createActionQueue();
|
||||
|
||||
this.autoClear = options.shouldAutoClear();
|
||||
this.autoClose = options.shouldAutoClose();
|
||||
@ -277,6 +269,14 @@ public SessionImpl(
|
||||
}
|
||||
}
|
||||
|
||||
protected StatefulPersistenceContext createPersistenceContext() {
|
||||
return new StatefulPersistenceContext( this );
|
||||
}
|
||||
|
||||
protected ActionQueue createActionQueue() {
|
||||
return new ActionQueue( this );
|
||||
}
|
||||
|
||||
private LockOptions getLockOptionsForRead() {
|
||||
return this.lockOptions == null ? fastSessionServices.defaultLockOptions : this.lockOptions;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user