File tree 1 file changed +6
-4
lines changed
src/NHibernate/Transaction
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -488,10 +488,12 @@ protected virtual void CompleteTransaction(bool isCommitted)
488
488
// In case of a rollback due to a timeout, we may have the session disposal running concurrently
489
489
// to the transaction completion in a way our current locking mechanism cannot fully protect: the
490
490
// session disposal "BeginProcess" can go through the Wait before it is locked but flag the
491
- // session as procesisng after the transaction completion has read it as not processing. To dodge
492
- // that case, we consider the session as still processing initially regardless of its actual
493
- // status in case of rollback.
494
- var isSessionProcessing = ! isCommitted || _session . IsProcessing ( ) ;
491
+ // session as processing after the transaction completion has read it as not processing. To dodge
492
+ // that very unlikely case, we could consider the session as still processing initially regardless
493
+ // of its actual status in case of rollback by changing below condition to
494
+ // "!isCommitted || _session.IsProcessing()". That would cause a Thread.Sleep in all rollback cases.
495
+ // That would reinforce the impracticality of that concurrency possibility, but with an ugly crutch.
496
+ var isSessionProcessing = _session . IsProcessing ( ) ;
495
497
try
496
498
{
497
499
// Allow transaction completed actions to run while others stay blocked.
You can’t perform that action at this time.
0 commit comments