none
SQL transaction fails without exception being thrown RRS feed

All replies

  • If you read that post Matt Neerincx explains about the fix. If that does not work, you might experience another issue and need to post more details here
    Val Mazur (MVP) http://www.xporttools.net
    Thursday, June 24, 2010 10:37 AM
    Moderator
  • I read the above mentioned post.

    Proper implementation of transaction scope in the entire application will need lot's of work.

    However; changing the connection string only is simple enough.

    I assume that I can use transaction binding = explicit unbind  in the sql connection string without using transaction scope.

    If I understand this then given the following example:

    Open connection (with transaction binding = explicit unbind)

    start transansaction

    update table 1

    update table 2    ( transaction times out at this point )

    update table 3   ( will throw an exception  and I can handle this situation without continuing with the rest of the updates)

    update table 4  ( will not even be executed because I got the exception while updating table 3)

    Commit transaction  (would also be skipped due to the trapped exception)

    Finally close the connection (would always execute this)

     

    Would this apprach allow me to trap transaction timeout?

    Is there any way of knowing why the transaction failed (ie. timeout vs any other error ?)

    If I can determine that the transaction timed out, then I can inform the user to wait and try the update again.

     

     

     

     

     

     

    Thursday, June 24, 2010 1:08 PM