Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Buffering vs Row Buffering
Message
From
24/07/2001 08:08:22
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
23/07/2001 16:42:50
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00533841
Message ID:
00534306
Views:
16
>>I saw a thread here just recently, but can't find it at the moment. Someone questioned the use of Row Buffereing (RB) over Table Buffering (TB). I was under the impression the RB was the preferred way and TB was used more when you were doing maintenance, etc. I thought the idea was that you only updated what you needed to update and that using TB was superfluous for the most part. Could someone give me a definative response as to when to use either RB or TB and why? Thanks!
>
>You should _definitely_ use table buffering more. It's valuable, in particular, when dealing with changes to multiple records that you may want to allow the user to rollback. For example, let's say you have customer walk in and after a few of their purchases have been entered, they suddenly run out. The user clicks cancel, for example, and you don't save the invoice. If the invoice detail is row buffered you have to go in, find the rows, and delete them, then cancel the invoice. If, OTOH, you're using table buffering you can simply TABLEREVERT() the detail table and the invoice and move on.
>
>So, if you have a parent => child relationship in your data entry, I'd say use table buffering for sure on the child table.
>
>The only really controversial question is whether to use row or table buffering on the parent. I used to be in the row-buffering camp, but Jim Booth convinced me otherwise.
>
>You can always, and easily, program so that changes are saved on the row level even with table buffering, but you can't control row buffering saves as easily. If you use row buffering, there are things that VFP does that can cause a row save to be done. That's undesirable--the program doing something as destructive (meaning a file is changed) on it's own.
>
>Whether to use buffering at all, or whether to use pessimistic or optimisitic are different issues. I never, personally, use pessimistic--because it's easy to code to achieve the same effect, and it's rarely needed in my experience, and I always use table. I always use buffering, but I know some people have specific issues with buffering. I'll have to let them address that, though.

Nancy,

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?

Renoir
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform