Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement