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() {
395395 checkSessionFactoryOpen ();
396396 checkOpenOrWaitingForAutoClose ();
397397 if ( getSessionFactoryOptions ().isReleaseResourcesOnCloseEnabled ()
398- || !isTransactionInProgressAndNotMarkedForRollback () ) {
398+ || !isTransactionInProgressAndNotMarkedForRollback () ) {
399399 super .close ();
400400 }
401401 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.
403408 prepareForAutoClose ();
404409 }
405410 }
You can’t perform that action at this time.
0 commit comments