WasCommitted and WasRolledback seem to be of no value.
I have a transaction that failed and I want to rollback the transaction so I have this code
Code:
if(this._session.Transaction.WasRolledBack == false) {
this._session.Transaction.Rollback();
}
but if I try to do the rollback I get this error:
This SqlTransaction has completed; it is no longer usable.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
So what is the proper way to determine if I should do the rollback or if it has been done for me and the transaction is closed?