Sorry, that was a hard question to word:
Say I have a stored procedure that does some inserting. It is wrapped in a transaction and commits, provided every goes well inside of that transaction.
Now, I call that transaction from a .net function. In this function, I have to call a few other functions that ALSO call stored procedures that are built in a similar fashion. Example:
bool SaveTicket()
{
using(MyTransaction)
{
try
{
SaveTicketInfo(); //calls sproc 1
SaveComments(); //calls sproc 2
SaveAttachments(); //calls sproc 3
}
catch(Exception)
{
MyTransactionRollback(); //i would normally wrap this in its own try/catch
}
}
}
Ok, so that's the skeleton of the process. What I actually do in my code is to check the return values of each of the three processes and if they return false, I throw an exception which triggers the rollback.
What I'm wondering, is if there are commits in those stored procedure, will my roll back in my .net function still work? Or is it completely useless?