Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tablerevert() vs rollback
Message
From
27/10/1999 07:48:54
 
 
To
27/10/1999 07:27:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00282114
Message ID:
00282121
Views:
29
>Not sure when to use each. Have a Grid with recordSourceType set to 1-Alias, which is a view. I'm Inserting from a list box. the changes made to the grid, whether it's changing the values of what is currently there or adding another row don't 'revert'. What exactly should be in the 'Cancel' button?

When dealing with updating a single table I generally use table buffering applying TABLEUPDATE() and TABLEREVERT() as needed. No rela need for a transaction (IMO).

When dealing with updating multiple tables that have related data, i.e. you don't want to have parents w/o children or ( more importantly ) children w/o parents I use table buffering in conjunction with transaction. You can work out the details but don't begin the transaction until you're ready to TABLEUPDATE() all the updates because starting a transaction will lock the tables up whule the transaction is in effect. If the TABLEUPDATE() is successful you can END TRANSACTION and you're on your way. If the TABLEUPDATE() is not successful, you can ROLLBACK so all the tables aer still in sync. But don't forget to TABLEREVERT() to reset the buffers of all buffered tables if the TABLEUPDATE() is not successful. Using a scheme of this type can get you maximum protection of your data integrity.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform