AfterTransactionCompletion called twice if a distributed transaction is rolled back
Description
Environment
None
discovered while testing
Activity
Show:

Oskar Berggren November 16, 2013 at 8:37 PM
Fix in 12676c1a97023e5d1e1751ba0a8f3a69ebc51790.
Fixed
Created November 16, 2013 at 6:54 PM
Updated June 9, 2016 at 4:17 AM
Resolved November 16, 2013 at 8:37 PM
Who's Looking?
If a session is opened and closed within a System.Transaction transaction, and that transaction is allowed to rollback, there will be two calls to the interceptor's AfterTransactionCompletion().
This is because DistributedTransactionContext.Rollback() will call sessionImplementor.AfterTransactionCompletion(false, null), which will then be called again by the TransactionCompleted event handler attached in AdoNetWithDistributedTransactionFactory.EnlistInDistributedTransactionIfNeeded().