Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering vs Begin..End Transaction
Message
De
25/12/1999 20:15:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00305569
Message ID:
00308582
Vues:
20
>>What if matter of change is replacing not adding new records? This way header should not be locked. In another scenario, IMO if buffering case includes adding new recors, then headers will be locked anyway. VFP suppose to lock headers (for short time) when it creates new record through buffer or with no buffer. As long as transaction is dynamic, locking will be handled by SET REPROCESS.
>
>Ed,
>
>Updating an existing record does not lock the dbf header at all, therefore the only thing locked is the exact record being updated and the multi-user conflict is limited to that record.
>
>The issue with using a transaction with unbuffered tables has to do with how long the locks are held not whether they are held or not. First transactions are not needed when one table is being updated, buffering and the proper use of tableupdate will insure that situation is completed properly.
>
>With a transaction the locks are held on all tables involved for the complete duration of the transaction. If the tables are buffered all of the calculations and field data changes have been accomplished (using direct replace statments if desired)outside of the transaction and the only thing that is in the transaction is the TaleUpdate calls making for a very short duration (since all activity is inside VFP and not interpreted lines of code doing replaces or gather statements). With unbuffered tables one either has to calculate a whole bunch of memvars to hold the data values before the transaction or else there are calculations going on inside the transaction which extends the duration of the transaction and thusly the locked record time.
>
>Keep in mind that none of this is talking about while the form is running, it is only the duration of the actual transaction. Buffered tables are not locked when you append a blank record outside of a transaction. The TableUpdate will hold a short lock adn a trnasaction will hold a lock until the transaction is committed or rooled back.


Hi Jim,
Seems I started a new discussion. Your point is good. This is not a reply but rather my addition.
Sometimes I have other situations where I really want to lock all recs in a session. ie: I have an employee tracking and want to revise their records as a supervisor (or boss). I do not want anyone to tamper while I'm doing it on per topmost parent basis (I want topmost parent+allchilds locked). Pessimistic buffering would be the one I would choose. But instead I could prefer a transaction and maybe just use it as a safety belt. Needs arise sometime. As always there are many ways to skin a cat in FP. So IMHO while transactions and buffering are in close relation none is dependant to other.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform