G
Guest
Weird behavior, at least to me, so not sure if this is correct
I have a function in a class that creates a connection object, opens it, creates a sql transaction object for that connection object, and then begins a try-catch block
Inside the try block, four functions are called, and each is passed the transaction object. Each function calls a stored procedure. And so on and so forth. Typical stuff
At the end of the try block, it commits the transaction. Inside the catch, it rollsback. If I put a "throw new Exception" call randomly in the various functions, every thing works as it is supposed to
What isn't typical, that I can tell, is this. If I am stepping through the debugger, and stop the debugger itself, whichever function I am in gets completed, and the transaction is committed
Neither points make sense. If I am in line 3 of a function that doesn't call the stored procedure until line 15, how does line 15 execute if I stop the debugger? And why does the transaction get committed before it ever gets to an explicit trans.Commit() line in the code
Is either expected behavior
TI
jdn
I have a function in a class that creates a connection object, opens it, creates a sql transaction object for that connection object, and then begins a try-catch block
Inside the try block, four functions are called, and each is passed the transaction object. Each function calls a stored procedure. And so on and so forth. Typical stuff
At the end of the try block, it commits the transaction. Inside the catch, it rollsback. If I put a "throw new Exception" call randomly in the various functions, every thing works as it is supposed to
What isn't typical, that I can tell, is this. If I am stepping through the debugger, and stop the debugger itself, whichever function I am in gets completed, and the transaction is committed
Neither points make sense. If I am in line 3 of a function that doesn't call the stored procedure until line 15, how does line 15 execute if I stop the debugger? And why does the transaction get committed before it ever gets to an explicit trans.Commit() line in the code
Is either expected behavior
TI
jdn