none
transaction state in catch block RRS feed

  • Question

  •  

    If I have a transaction (system.transaction) in a try / catch block and the item wrapped by the transaction creates an exception normally examples show the rollback and some sort of error reporting,

     

    if I need to retry the action that was in the try block in the catch block do I need to do anything with the transaction or is it still valid in the catch block?

    Monday, April 28, 2008 11:27 PM

Answers

  • As long as you're very selective about what you catch.  A rollback on a connection timeout exception isn't going to work out well.  Post in a database forum to get a better answer.
    Tuesday, April 29, 2008 12:28 AM
    Moderator

All replies

  • Assuming the transaction is not declared within the scope of the try block (which I'm certain it won't be) then I believe the transaction should still be valid based on the 'examples' statement you made. A code sample would make it easy to confirm.
    Monday, April 28, 2008 11:38 PM
  • As long as you're very selective about what you catch.  A rollback on a connection timeout exception isn't going to work out well.  Post in a database forum to get a better answer.
    Tuesday, April 29, 2008 12:28 AM
    Moderator