Re: Rollback timeout ???

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

From: Mike (mberger_at_skypoint.com)
Date: 02/01/05


Date: Tue, 1 Feb 2005 14:10:20 -0600

I'm not sure how I would "make sure the transaction is completed". I know my
updating is done, and I have done a oTran.Commit or a Command object
"Rollback transaction". Are you advocating doing a oTran.Dispose() before I
do a oConn.Close() ?

Thanks,
Mike

"Angel Saenz-Badillos[MS]" <angelsa@online.microsoft.com> wrote in message
news:eTTrJRJCFHA.2076@TK2MSFTNGP15.phx.gbl...
> I actually like and would recommend using the tsql Begin Transaction
instead
> of the API, this allows you to set the timeout on the command very
clearly.
> Some things to keep in mind:
>
> Don't mix the two, it will get confusing.
> Make _sure_ (by using a finally clause) that your transaction is
completed
> before closing the connection. Otherwise you will leak the transaction for
> the ammount of time the connection remains in the pool.
>
> As to setting the transaction timeout period for the BeginTransaction
API...
> We hardcode this value to the Connection Timeout (default 15 seconds) so
> this could be used as a workarround.
>
> --
> Angel Saenz-Badillos [MS] Managed Providers
> This posting is provided "AS IS", with no warranties, and confers no
> rights.Please do not send email directly to this alias.
> This alias is for newsgroup purposes only.
> I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/
>
>
>
>
> "Miha Markic [MVP C#]" <miha at rthand com> wrote in message
> news:eRuV9dDCFHA.1392@tk2msftngp13.phx.gbl...
> > Hi Mike,
> >
> > You are right - you can't set rollback timeout (this is a "feature").
> > Instead you can issue your own "rollback transaction" command.
> > See this thread:
> >
>
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.adonet/browse_frm/thread/da5daf08504d40fd/2c1324abac6a646b?q=Rollback+timeout+group:*adonet*&_done=%2Fgroups%3Fas_q%3DRollback+timeout%26safe%3Dimages%26as_ugroup%3D*adonet*%26lr%3D%26hl%3Den%26&_doneTitle=Back+to+Search&&d#2c1324abac6a646b
> >
> > --
> > Miha Markic [MVP C#] - RightHand .NET consulting & development
> > SLODUG - Slovene Developer Users Group
> > www.rthand.com
> >
> > "Mike" <mberger@skypoint.com> wrote in message
> > news:O7edncokL80bemPcRVnygw@skypoint.com...
> > >I have a vb.net application. Using ado.net, I create/open a connection,
> > > create a transaction object, and go through a loop. In each interation
> of
> > > the loop, I create a SqlClient.SqlCommand (using this transaction
> object)
> > > and perform a cmd.ExecuteNonQuery using a SQL Update statement. After
> > > everything is said and done, I have transaction object with about
12,000
> > > updates in it. If I try a trans.Rollback, I get a
SqlClient.SqlException
> > > that is a timeout exception. How does a rollback timeout ? The
> > > SqlClient.SqlTransaction object does not have a timeout property.
Anyone
> > > know where this comes from ?
> > >
> > > Thanks,
> > > Mike
> > >
> > >
> >
> >
>
>


Quantcast