Re: Scope of transaction processing wrapper



Yes, that all sounds right.

Just pass the Database variable, and it will all rollback.

This article illustrates transactions:
http://allenbrowne.com/ser-37.html
It all happens in one procedure, so it does not illustrate passing the db,
but the technique is identical, and it does explain a couple of traps.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"rdemyan via AccessMonster.com" <u6836@uwe> wrote in message
news:5d32b3ce99067@xxxxxx
Allen:

Thank you for the response. I'm using different DAO workspace, database
and
recordset variables in the procedures that update Tables B and C. I'm not
using db.Execute type statements, but instead rsXXX.AddNew or rsXXX.Edit
and
rsXXX.Update.

Does this mean that I should pass the DAO variables that update TableA
into
the procedures that update TablesB and C. Do I just pass in the ws and db
variables and then create a new recordset based on the SQL statement that
is
appropriate for each procedure to accomplish that procedure's job?

If so, I assume that these DAO variables should still be closed in the
original module that created them (i.e. where TableA is updated).

Thanks.

Allen Browne wrote:
The answer to your question depends on how you write the changes to the
other tables.

If you write the changes with something like:
db.Execute ...
where db is the database in the ws workspace, then they will rollback.

But they will not roll back if you make the changes with (say) RunSQL, or
through another Workspace variable, since these are outside of the scope
of
your transaction.

I have some unbound forms that I want to use transaction wrappers on when
updating the table. My question is on the scope of what transaction
[quoted text clipped - 35 lines]
handler. Will the Rollback statement roll back the changes to all three
tables (A, B and C) or will it only roll back Table A??

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200603/1


.



Relevant Pages

  • Re: Question on Transactions for Allen Browne
    ... Did you BeginTrans on the WorkSpace? ... Or did you BeginTrans on the Database? ... I was trying to troubleshoot an issue I was having with a Transaction, ... The problem I was having was an error 3034 when trying to Rollback a failed ...
    (microsoft.public.access.formscoding)
  • Re: global synchronization point
    ... I'm not thinking of the transaction begin/commit/rollback cycle, ... and rollbacks, and then do a global rollback to a given point of time. ... If you perform database+transaction log dumps for your database ... For ASE servers, @@verion is a server-wide, global variable that ...
    (comp.databases.sybase)
  • Re: Calling BeginTrans without Commit / RollBack
    ... That is correct, rollback is guaranteed ... > locks acquired by the transaction. ... >> Will there be any negative impact on the database if one ... >> commit/rollback commands, e.g. a sudden blackout. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Calling BeginTrans without Commit / RollBack
    ... > rights.Please do not send email directly to this alias. ... >> think sql server should rollback the transaction itself and release any ... >> locks acquired by the transaction. ... >> left on the database. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Help - Timing Logic
    ... server application, both of which ran on the same box. ... the client applications and 'lodging' them in the database. ... Another part of the server application was dedicated to retrieving messages ... commit transaction ...
    (microsoft.public.dotnet.languages.vb)