.net - Will an exception created during rollback logic within another catch wipeout the stack trace of the original exception? -
I have a method, which a) inserts a line in the table, and then b) the resulting identity value is used multiple If the argument in Part B fails for any reason in another table, then I need to rollback all the inclusions for parts B and A. I am quite sure that the transactions will not work for it, although I am otherwise convinced. I have a "main" method that manages calling both A and B, in ways that are surrounded by a try-gap. What I am thinking, if I call a method which is the main method If rollback performance is from the grip and fails in some rollback method, an exception will be caught in the rollback method (I want to log in it) eliminating the stack trace (or something else) the main method of exception Caught in? Code example:
Public class DoSomeStuff {Public Zero MainMethod (...) {int intro; Try {identity = DoFirstInsert (...); DoSubsequentEnerts (Identity, ....); Hold (rollback stick); throw; }} Cancellation of Rollback Stuff (Intident Identity) {Try {Database Contains for Rollback Inserts} Hold (Exception Pre) {// Log Rollback Error, Do not Thought // Does It Exclude Exception in Main Mathematics () Will you? thank you in advanced.
The transaction should work. Insert all included in the same transaction, which gives an identity column.
Comments
Post a Comment