Cannot Reproduce
Details
Details
Assignee
Former user
Former user(Deactivated)Reporter
Edward
EdwardComponents
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created March 29, 2005 at 6:23 AM
Updated May 13, 2005 at 1:10 PM
Resolved May 13, 2005 at 1:10 PM
I have reviewed AdoTransaction.cs . and I found, It is better that reset committed and rolledBack to false after start transaction successfully.
Because if we start a transaction and commit, then, we call session.BeginTransaction to start another transaction, but at this time, session.Transaciton.WasCommitted returns true.
So reset commited and rolledBack after successful to start transaction is necessary.
eg:
public void Begin()
{
log.Debug( "begin" );
try
{
IsolationLevel isolation = session.Factory.Isolation;
if( isolation == IsolationLevel.Unspecified )
{
trans = session.Connection.BeginTransaction();
}
else
{
trans = session.Connection.BeginTransaction( isolation );
}
committed = false;
rolledBack = false;
}
catch( Exception e )
{
log.Error( "Begin transaction failed", e );
throw new TransactionException( "Begin failed with SQL exception", e );
}
begun = true;
}