Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transactions
Message
From
30/03/2001 09:07:32
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00490206
Message ID:
00490298
Views:
6
>Actually that is what I have done. Before I begin my transaction I do all the updating, then begin the transaction and if any of the updates fail I issue a rollback and then do tablerevert on all the tables. But is this an ok procedure to follow in the future. Should I have instead done my updating say on one table within the transaction, issue a tableupdate and if that failed issue a rollback before attempting to update the second table. Or is it ok to do all the updating outside the transaction and then issue rollback and table revert on all the tables.


You must do the tableupdates inside the transaction. So, the sequence of things will be:


BEGIN TRANSACTION
result = TABLEUPDATE(Table1)
IF Result = .t.
Result = TABLEUPDATE(Table2)
ENDIF
IF Result = .t.
Result = TABLEUPDATE(Table3)
ENDIF
* Update other tables the same way
IF Result = .T.
ENDTRANSACTION
ELSE
ROLLBACK
ENDIF
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform