I have a procedure Proc1 that calls another procedure Proc2, and both with "BEGIN TRANSCTION" If i get an error at the second procedure, it will rollback both procedures. OK!
But inside my C# code, i have also this
...
dbCommand.Transaction.Commit();
dbCnn.Close();
}
catch (Exception ex)
{
if (dbCommand.Transaction != null)
**dbCommand.Transaction.Rollback();**
if (dbCnn.State == ConnectionState.Open)
dbCnn.Close();
throw ex;
}
Does "dbCommand.Transaction.Rollback();" knows which transaction I am talking about? And if I have two transactions ate the same procedure, without label, will it be a problem for C# rollback the right transaction?