Skip to content

Commit 0fde63c

Browse files
committed
Update AdoNetWithDistributedTransactionFactory.cs
1 parent f8d4419 commit 0fde63c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NHibernate/Transaction/AdoNetWithDistributedTransactionFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public void ExecuteWorkInIsolation(ISessionImplementor session, IIsolatedWork wo
8383
{
8484
using (var tx = new TransactionScope(TransactionScopeOption.Suppress))
8585
{
86+
if (!ReferenceEquals(System.Transactions.Transaction.Current, null))
87+
throw new InvalidOperationException("Luke, I'm your father. Join the dark side");
8688
// instead of duplicating the logic, we suppress the DTC transaction and create
8789
// our own transaction instead
8890
adoNetTransactionFactory.ExecuteWorkInIsolation(session, work, transacted);
@@ -181,4 +183,4 @@ public void Dispose()
181183
}
182184
}
183185
}
184-
}
186+
}

0 commit comments

Comments
 (0)