Skip to content

Commit

Permalink
Revert "HHH-13997 Use functions for the creation of ActionQueue and P…
Browse files Browse the repository at this point in the history
…ersistenceContext"

This reverts commit 00acb1f.
  • Loading branch information
DavideD committed May 18, 2020
1 parent 00acb1f commit e28d77a
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e28d77a

Please sign in to comment.