Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Buffering vs Row Buffering
Message
From
24/07/2001 12:22:58
 
 
To
24/07/2001 08:08:22
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00533841
Message ID:
00534474
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
Renoir-

>Assume a buffered base table called Codes and two views called vCodes and vDetail. I normally do something like the following using Optimistic Row Buffering:
>
>
>If TableUpdate(.T.,.T.,'vDetail') = .F.
>     Tablerevert('vDetail')
>     Wait Window '  Save record Failed!  ' timeout 3
>Else
>     Tableupdate(.T.,.T.,'Codes')
>     Requery('vCodes')
>     Requery('vDetail')
>Endif
>
>
>If I just change the buffering settings to 5 instead of 3 do I have any other concerns or will it just happily start using table buffering?

Well, this little bit of code? No, since your forcing an update to all rows. But of course there's no way to say for the rest of your application.

FWIW, this is fairly brutish (not that I haven't done it this way, too). What if another user has made a change to a record? They just lost their changes.

Also, you need to check the return from the Codes update. It might fail.
IF TableUpdate OneTable
  IF TableUpdate AnotherTable
    Great!
  ELSE
    TableRevert, or give the user some message about the failure and a chance to revert.
  ENDIF
ELSE
    TableRevert, or give the user some message about the failure and a chance to revert.
ENDIF
Note that nesting these really implies a need for Transactions, as has been pointed out to you.

Always, always, always check the return from tableupdate.
Previous
Reply
Map
View

Click here to load this message in the networking platform