Re: SqlTransactions and Sql timeout errors

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Adam (adam.pridmore_at_threex.co.uk)
Date: 11/01/04


Date: 1 Nov 2004 04:34:02 -0800

Thanks.

Just another quick questions, but is there a reason why sql timeout
exceptions cause it to rollback automatically? Is it to do with the
way MS SQL server handles timeout errors as apposed to other runtime
SQL errors?

Adam

Mary Chipman <mchip@online.microsoft.com> wrote in message news:<9ruao0l9foa203qovu0nkfu5h30k7vknk7@4ax.com>...
> You'll need to wrap your Rollback in its own try/catch block since
> you'll just be triggering a runtime error if you try to roll it back
> and it's not active. One way to keep track of what's going on is to
> create a variable that gets set to different values in your various
> Catch blocks. You can see an example in the Rollback help topic in the
> Help file -- instead of console.writeline shown here, just write to
> your variable:
> ms-help://MS.VSCC.2003/MS.MSDNQTR.2004APR.1033/cpref/html/frlrfSystemDataSqlClientSqlTransactionClassRollbackTopic.htm
>
> --Mary
>
>



Relevant Pages

  • Re: controlling lock order in transactions
    ... > and the trigger issued a rollback your commit or rollback would error. ... > Andrew J. Kelly SQL MVP ... >> taken) for the duration of the transaction. ... >> find in the clients sp that could be causing the dead lock is the join on ...
    (microsoft.public.sqlserver.programming)
  • Re: Transactions - rollback
    ... problem is with SQL Server's error handling. ... Kalen Delaney's Inside SQL and Erland Sommarskog's articles on ... > Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK ... > COMMIT TRAN ...
    (microsoft.public.sqlserver.server)
  • Re: SqlTransactions and Sql timeout errors
    ... > I seem to be having a strange problem when an sql statement times out ... > when it is running inside a transaction. ... > InvalidOperationException when I try and rollback the transaction. ... > And in the case of invalid SQL the rollback complete's OK. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SqlTransactions and Sql timeout errors
    ... > I seem to be having a strange problem when an sql statement times out ... > when it is running inside a transaction. ... > InvalidOperationException when I try and rollback the transaction. ... > And in the case of invalid SQL the rollback complete's OK. ...
    (microsoft.public.dotnet.framework.adonet)