Re: Rollback transaction
- From: "Val Mazur \(MVP\)" <group51a@xxxxxxxxxxx>
- Date: Wed, 20 Apr 2005 20:29:52 -0400
Hi,
As Santhana suggested you could store your temporary data in a recordset or
you could create some sort of working table in a database, which will hold
temp data. As soon as you finish processing of the forms you could transfer
data from this table into actual transactions table. Do not keep connection
opened for long time, especially with the opened transaction against it. It
could lead to the dead locking issues.
--
Val Mazur
Microsoft MVP
http://xport.mvps.org
"steven scaife" <stevenscaife@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CE699F98-FC53-46CB-9CD7-0766284BBE21@xxxxxxxxxxxxxxxx
>I am unsure how to do this but what i need to do is this:
>
> My users have 12 forms to collect all the financial info of a client,
> personal details insurance policies and other stuff. At the moment when
> all
> 12 forms are completed the user hits a button and my stored procedures run
> saving the info to the database.
>
> I have been asked to make the program autosave to the database after each
> form is completed, however if they close down the program before the forms
> are completed I need to rollback the changes.
>
> I know if I had a connection open across all the forms i could call
> rollbacktran of the connection object. However I have always been taught
> to
> close the database connection as soon as possible, and in the environment
> I
> am people will leave the forms open over night or during dinner, I dont
> know
> how much overhead there is from leaving the connection open or whether it
> is
> good practice to do so, I assume its not.
>
> Am I right in thinking that I cant roll back through the connection object
> if I am opening and closing on each page
>
> Could I do this at the start page
>
> conn.execute("begin transaction")
>
> and on the last page when its complete have conn.execute("commit
> transaction")
>
> This would then mean that the changes are not saved if they exit before
> the
> commit is sent. Am I correct in thinking this or am I way off the mark,
> or
> even is there a better way of going about it
>
> if you need more information dont hesitate to ask
>
> TIA
>
> Steven Scaife
.
- References:
- Rollback transaction
- From: steven scaife
- Rollback transaction
- Prev by Date: Re: using ADODB from excel-VBA with stored procedures in a SQLserver
- Next by Date: Re: multiple connections
- Previous by thread: RE: Rollback transaction
- Index(es):
Loading