W
Wells Caughey
I have looked in the documentation and I have looked in Google, but I cannot
seem to find an answer: If a transaction has been opened and the transaction
is disposed before calling Commit or Rollback, am I guarenteed that the
transaction will be rolled back? For example:
try
{
sqlConnection.Open();
using(sqlTransaction = sqlConnection.BeginTransaction())
{
/// do stuff but do not call sqlTransaction.Commit() or
sqlTransaction.Rollback()
/// ...
} /// <- will the transaction be rolled back here?
}
finally
{
sqlConnection.Close();
}
Thanks,
Wells
seem to find an answer: If a transaction has been opened and the transaction
is disposed before calling Commit or Rollback, am I guarenteed that the
transaction will be rolled back? For example:
try
{
sqlConnection.Open();
using(sqlTransaction = sqlConnection.BeginTransaction())
{
/// do stuff but do not call sqlTransaction.Commit() or
sqlTransaction.Rollback()
/// ...
} /// <- will the transaction be rolled back here?
}
finally
{
sqlConnection.Close();
}
Thanks,
Wells