Re: Error when calling SqlTransaction.Rollback method
From: Marina (someone_at_nospam.com)
Date: 03/08/04
- Next message: Earl: "Re: Convince me this is a table name or "TableMapping" error?"
- Previous message: William Ryan eMVP: "Re: DataView"
- In reply to: Jamie Schatte: "Error when calling SqlTransaction.Rollback method"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 8 Mar 2004 15:27:12 -0500
I've seen this when there was an open data reader on the same connection as
the transaction. If this is the case, you need to close the data reader
before rolling back the transaction.
To get the exception, just debug into your code, or alternatively,
temporarily remove the rollback code or place it in its own try catch.
In general though, it is a good idea to post relevant code with these types
of questions.
"Jamie Schatte" <jamie@lmtt.com> wrote in message
news:Ox0KAEUBEHA.1796@TK2MSFTNGP12.phx.gbl...
> We are running an ASP.NET 1.1 application that allows users to update data
> in a SQL Server 2000 database. All of these updates follow the same
general
> flow as shown in the sample code below. This usually works great, but
every
> now and then the following exception is thrown when calling the Rollback
> method:
>
> "The SqlCommand is currently busy Open, Fetching"
>
> I am not sure what is causing this exception. It seems like this is a
> secondary exception that occurs during the Rollback, which means I am
losing
> the original exception that caused the Rollback to get called in the first
> place.
>
> Thanks in advance for any help.
>
> Jamie Schatte
> Fidelis Software
>
> --------------------------------------- SAMPLE CODE
> BELOW ----------------------------------------------
>
> objSqlConnection.Open()
> Try
> objSqlTransaction = objSqlConnection.BeginTransaction
> ' ***** DO SOME SORT OF UPDATES HERE *****
> objSqlTransaction.Commit()
> Catch objException As Exception
> objSqlTransaction.Rollback()
> Throw objException
> Finally
> objSqlConnection.Close()
> End Try
>
>
>
- Next message: Earl: "Re: Convince me this is a table name or "TableMapping" error?"
- Previous message: William Ryan eMVP: "Re: DataView"
- In reply to: Jamie Schatte: "Error when calling SqlTransaction.Rollback method"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|