Skip to content

Commit e8d2f12

Browse files
fixup! Fix dependent transaction failure
1 parent 064818b commit e8d2f12

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/NHibernate/AdoNet/ConnectionManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,13 @@ public DbCommand CreateCommand()
456456
public void EnlistIfRequired(System.Transactions.Transaction transaction)
457457
{
458458
if (transaction == _currentSystemTransaction)
459+
{
460+
// Short-circuit after having stored the transaction : they may be equal, but not the same reference.
461+
// And the previous one may be an already disposed dependent clone, in which case we need to update
462+
// our reference.
463+
_currentSystemTransaction = transaction;
459464
return;
465+
}
460466

461467
_currentSystemTransaction = transaction;
462468

0 commit comments

Comments
 (0)