File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
hibernate-core/src/main/java/org/hibernate/internal Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -395,11 +395,16 @@ public void closeWithoutOpenChecks() {
395
395
checkSessionFactoryOpen ();
396
396
checkOpenOrWaitingForAutoClose ();
397
397
if ( getSessionFactoryOptions ().isReleaseResourcesOnCloseEnabled ()
398
- || !isTransactionInProgressAndNotMarkedForRollback () ) {
398
+ || !isTransactionInProgressAndNotMarkedForRollback () ) {
399
399
super .close ();
400
400
}
401
401
else {
402
- //Otherwise, session auto-close will be enabled by shouldAutoCloseSession().
402
+ // In the JPA bootstrap, if the session is closed
403
+ // before the transaction commits, we just mark the
404
+ // session as closed, and set waitingForAutoClose.
405
+ // This method will be called a second time from
406
+ // afterTransactionCompletion when the transaction
407
+ // commits, and the session will be closed for real.
403
408
prepareForAutoClose ();
404
409
}
405
410
}
You can’t perform that action at this time.
0 commit comments