Skip to content

Commit c90465b

Browse files
Apply review
1 parent dd95913 commit c90465b

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

src/NHibernate/Engine/ISessionImplementor.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,7 @@ internal static IDisposable BeginProcess(this ISessionImplementor session)
6767
}
6868

6969
internal static bool IsProcessing(this ISessionImplementor session)
70-
{
71-
if (session == null)
72-
return false;
73-
return session is AbstractSessionImpl impl
74-
? impl.IsProcessing
75-
: false;
76-
}
70+
=> session is AbstractSessionImpl impl && impl.IsProcessing;
7771

7872
//6.0 TODO: Expose as ISessionImplementor.FutureBatch and replace method usages with property
7973
internal static IQueryBatch GetFutureBatch(this ISessionImplementor session)

src/NHibernate/Transaction/AdoNetWithSystemTransactionFactory.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,11 @@ protected virtual void CompleteTransaction(bool isCommitted)
476476
// Throwing would give up attempting to close the session if need be, which may still succeed. So,
477477
// just log an error.
478478
_logger.Error(
479-
"A synchronization timeout occurred at transaction completion: the session is still processing. Attempting " +
480-
"to finalize the transaction concurrently, which may cause thread safety failure. You may " +
481-
"raise {0} if it is set too low. It may also be a limitation of the data provider, like not " +
482-
"supporting transaction scope timeouts occurring on concurrent threads.",
479+
"A synchronization timeout occurred at transaction completion: the session is still processing. " +
480+
"Attempting to finalize the transaction concurrently, which may cause a thread concurrency failure. " +
481+
"You may raise {0} if it is set too low. It may also be a limitation of the data provider, " +
482+
"like locks applied on its side while processing transaction cancellations occurring on concurrent threads, " +
483+
"thus preventing the session to finish its current processing during a transaction cancellation.",
483484
Cfg.Environment.SystemTransactionCompletionLockTimeout);
484485
}
485486
}
@@ -526,10 +527,11 @@ protected virtual void CompleteTransaction(bool isCommitted)
526527
if (isSessionProcessing)
527528
{
528529
throw new HibernateException(
529-
"A synchronization timeout occurred at transaction completion: the session was still processing. You may " +
530-
$"raise {Cfg.Environment.SystemTransactionCompletionLockTimeout} if it is set too low. It may also " +
531-
"be a limitation of the data provider, like not supporting transaction scope timeouts occurring on " +
532-
"concurrent threads.");
530+
"A synchronization timeout occurred at transaction completion: the session was still processing. " +
531+
$"You may raise {Cfg.Environment.SystemTransactionCompletionLockTimeout} if it is set too low. " +
532+
"It may also be a limitation of the data provider, " +
533+
"like locks applied on its side while processing transaction cancellations occurring on concurrent threads, " +
534+
"thus preventing the session to finish its current processing during a transaction cancellation.");
533535
}
534536
}
535537

0 commit comments

Comments
 (0)