Home > Archive > Microsoft SQL Server forum > June 2005 > Transaction not commited rollback?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Transaction not commited rollback?
Larry

2005-06-30, 1:24 pm

In VB 6, using ADO, SQL Server 2000

In my VB program I use the connection object (abc)
to begin a transaction.

abc.BeginTrans

I then, in my VB App, using ADO, execute multiple stored procedures
inserting records into temp tables ##Meetings,
reading them, and then finnaly executing (from my VB app
using ADO) as stored procedure that inserts records
into a non-temp table.

I then have a abc.CommitTrans

What if my VB program crashes before the
committrans is executed, I assume that the transaction
is rolled back, even though no explicit rollback
is issued, because my VB program has crashed.

Thank You for your help,

Laurence Nuttall
Programmer Analyst III
UCLA - Division of Continuing Education
Erland Sommarskog

2005-06-30, 8:23 pm

Larry (Bliff@Bliff.com) writes:
> In VB 6, using ADO, SQL Server 2000
>
> In my VB program I use the connection object (abc)
> to begin a transaction.
>
> abc.BeginTrans
>
> I then, in my VB App, using ADO, execute multiple stored procedures
> inserting records into temp tables ##Meetings,
> reading them, and then finnaly executing (from my VB app
> using ADO) as stored procedure that inserts records
> into a non-temp table.
>
> I then have a abc.CommitTrans
>
> What if my VB program crashes before the
> committrans is executed, I assume that the transaction
> is rolled back, even though no explicit rollback
> is issued, because my VB program has crashed.


Yes.

If you want to verify - and this is a good exercise just try it. For
instance run the program from the VB debugger set a break point somewhere,
and then kill VB from the Task Manager. Now check that there is no data
which should not be there.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com