27
27
import jakarta .persistence .PessimisticLockScope ;
28
28
import jakarta .persistence .Timeout ;
29
29
import jakarta .persistence .metamodel .EntityType ;
30
- import org .hibernate .*;
30
+ import org .hibernate .BatchSize ;
31
+ import org .hibernate .CacheMode ;
32
+ import org .hibernate .ConnectionAcquisitionMode ;
33
+ import org .hibernate .ConnectionReleaseMode ;
34
+ import org .hibernate .EnabledFetchProfile ;
35
+ import org .hibernate .EntityFilterException ;
36
+ import org .hibernate .FetchNotFoundException ;
37
+ import org .hibernate .FlushMode ;
38
+ import org .hibernate .HibernateException ;
39
+ import org .hibernate .Interceptor ;
40
+ import org .hibernate .JDBCException ;
41
+ import org .hibernate .LobHelper ;
42
+ import org .hibernate .LockMode ;
43
+ import org .hibernate .LockOptions ;
44
+ import org .hibernate .MappingException ;
45
+ import org .hibernate .MultiIdentifierLoadAccess ;
46
+ import org .hibernate .NaturalIdLoadAccess ;
47
+ import org .hibernate .NaturalIdMultiLoadAccess ;
48
+ import org .hibernate .ObjectDeletedException ;
49
+ import org .hibernate .ObjectNotFoundException ;
50
+ import org .hibernate .ReadOnlyMode ;
51
+ import org .hibernate .ReplicationMode ;
52
+ import org .hibernate .Session ;
53
+ import org .hibernate .SessionBuilder ;
54
+ import org .hibernate .SessionEventListener ;
55
+ import org .hibernate .SessionException ;
56
+ import org .hibernate .SharedSessionBuilder ;
57
+ import org .hibernate .SimpleNaturalIdLoadAccess ;
58
+ import org .hibernate .Transaction ;
59
+ import org .hibernate .TypeMismatchException ;
60
+ import org .hibernate .UnknownProfileException ;
61
+ import org .hibernate .UnresolvableObjectException ;
31
62
import org .hibernate .action .spi .AfterTransactionCompletionProcess ;
32
63
import org .hibernate .bytecode .enhance .spi .interceptor .EnhancementAsProxyLazinessInterceptor ;
33
64
import org .hibernate .collection .spi .PersistentCollection ;
@@ -482,7 +513,10 @@ protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordin
482
513
return !isTransactionCoordinatorShared ;
483
514
}
484
515
485
- @ Override
516
+ /**
517
+ * Should this session be automatically closed after the current
518
+ * transaction completes?
519
+ */
486
520
public boolean isAutoCloseSessionEnabled () {
487
521
return autoClose ;
488
522
}
@@ -521,7 +555,6 @@ private void managedFlush() {
521
555
}
522
556
}
523
557
524
- @ Override
525
558
public boolean shouldAutoClose () {
526
559
if ( waitingForAutoClose ) {
527
560
return true ;
@@ -2198,7 +2231,7 @@ public SharedSessionBuilderImpl connectionHandlingMode() {
2198
2231
2199
2232
@ Override
2200
2233
public SharedSessionBuilderImpl autoJoinTransactions () {
2201
- super .autoJoinTransactions ( session .isAutoCloseSessionEnabled () );
2234
+ super .autoJoinTransactions ( session .shouldAutoJoinTransaction () );
2202
2235
return this ;
2203
2236
}
2204
2237
@@ -2222,7 +2255,7 @@ public SharedSessionBuilderImpl flushMode() {
2222
2255
2223
2256
@ Override
2224
2257
public SharedSessionBuilderImpl autoClose () {
2225
- autoClose ( session .autoClose );
2258
+ autoClose ( session .isAutoCloseSessionEnabled () );
2226
2259
return this ;
2227
2260
}
2228
2261
0 commit comments