Re: Error when calling SqlTransaction.Rollback method

From: Marina (someone_at_nospam.com)
Date: 03/08/04


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
>
>
>



Relevant Pages

  • BEGIN TRANSACTION problem
    ... there was no BEGIN TRANSACTION. ... The test prior to the exception is the first to execute the parent ... The is the exception the unit test is expecting. ... Rollback statement faile with "The ROLLBACK TRANSACTION request has no ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Another question regarding exceptions and loops
    ... In this case I define a transaction as saving a single Contact not the List ... > I think that having separate exceptions for when the list is partially ... > rollback for this kind of thing? ... if there is an exception that is thrown (and I hope you are ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How To Tell Youre Within An Exception?
    ... using (Transaction transaction = new Transaction()) ... Rollbackif the current process is currently unwinding an exception ... I want to call Commitwithin the Dispose() ... Allthough in most cases you may rollback on error and commit on success, ...
    (microsoft.public.dotnet.framework.clr)
  • Re: JSTL - <sql:transaction>, rollback?
    ... > reason for JSTL to decide to rollback a transaction. ... the exception will be committed if the sql:transaction tag ...
    (comp.lang.java.programmer)
  • RE: HELP on New request is not allowed to start because [1264822]
    ... allowed to start because it should come with valid transaction descriptor. ... System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean ... TRXOrders.CLogin.GetTradexUserIDFromQube(String QubeUserID, String GroupCode) ... This error always occurs when we issue the command to SQL Server. ...
    (microsoft.public.dotnet.framework.adonet)