File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
hibernate-core/src/main/java/org/hibernate/internal Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ public class SessionFactoryImpl implements SessionFactoryImplementor {
197197 private final transient FastSessionServices fastSessionServices ;
198198 private final transient SessionBuilder defaultSessionOpenOptions ;
199199 private final transient SessionBuilder temporarySessionOpenOptions ;
200+ private final transient StatelessSessionBuilder defaultStatelessOptions ;
200201
201202 public SessionFactoryImpl (
202203 final MetadataImplementor metadata ,
@@ -381,6 +382,7 @@ public void sessionFactoryClosed(SessionFactory factory) {
381382
382383 this .defaultSessionOpenOptions = createDefaultSessionOpenOptionsIfPossible ();
383384 this .temporarySessionOpenOptions = this .defaultSessionOpenOptions == null ? null : buildTemporarySessionOpenOptions ();
385+ this .defaultStatelessOptions = this .defaultSessionOpenOptions == null ? null : withStatelessOptions ();
384386 this .fastSessionServices = new FastSessionServices ( this );
385387
386388 this .observer .sessionFactoryCreated ( this );
@@ -503,7 +505,12 @@ public StatelessSessionBuilder withStatelessOptions() {
503505 }
504506
505507 public StatelessSession openStatelessSession () {
506- return withStatelessOptions ().openStatelessSession ();
508+ if ( this .defaultStatelessOptions != null ) {
509+ return this .defaultStatelessOptions .openStatelessSession ();
510+ }
511+ else {
512+ return withStatelessOptions ().openStatelessSession ();
513+ }
507514 }
508515
509516 public StatelessSession openStatelessSession (Connection connection ) {
You can’t perform that action at this time.
0 commit comments