File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/NHibernate/Transaction Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,20 @@ public override void EnlistInSystemTransactionIfNeeded(ISessionImplementor sessi
46
46
if ( session == null )
47
47
throw new ArgumentNullException ( nameof ( session ) ) ;
48
48
49
- var connectionManager = session . ConnectionManager ;
50
- if ( ! connectionManager . ShouldAutoJoinTransaction ||
51
- // Shortcut for avoiding accessing Transaction.Current, which is costly.
52
- session . TransactionContext != null && ! connectionManager . ProcessingFromSystemTransaction )
53
- {
49
+ if ( ! ShouldAutoJoinSystemTransaction ( session ) )
54
50
return ;
55
- }
56
51
57
52
JoinSystemTransaction ( session , System . Transactions . Transaction . Current ) ;
58
53
}
59
54
55
+ private static bool ShouldAutoJoinSystemTransaction ( ISessionImplementor session )
56
+ {
57
+ var connectionManager = session . ConnectionManager ;
58
+ return connectionManager . ShouldAutoJoinTransaction &&
59
+ // Shortcut for avoiding accessing Transaction.Current, which is costly.
60
+ ( session . TransactionContext == null || connectionManager . ProcessingFromSystemTransaction ) ;
61
+ }
62
+
60
63
/// <inheritdoc />
61
64
public override void ExplicitJoinSystemTransaction ( ISessionImplementor session )
62
65
{
You can’t perform that action at this time.
0 commit comments