Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking Table
Message
 
 
À
05/09/2001 06:16:35
Henry Sudarma
Jakarta Institute of Technology
Jakarta, Indonésie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00552391
Message ID:
00552393
Vues:
15
Hi!

There are different buffering modes. When you require locking, use buffering mode 2 (pessimistic row buffering) or 4 (pessimistic table buffering). These buffering modes, when used for table and NOT for view, will lock the table just when any field is modified.

Be aware that record is updated automatically when using row buffering as soon as record pointer moved in the table (or table is displayed in the grid); when you need this, use table buffering.

You can change buffering mode for table using cursorsetprop('Buffering',...) function.

However, there is an approach without using of locking (pessimistic buffering). Tableupdate() function has a parameter - if it is .F., it will not update table if it is already modified by another user. If tableupdate(.F.,...) returns .F., you can compare the values of OldVal() and CurVal() functions to see which fields were changed by another used (OldVal() - value of field before you changed it, CurVal() - current value of field in the table - that is what modified by current user). If they do not match, that field was changed.

Good application locks records for as little time as possible, thus avoid using of locking during the moment when user edits record. What if user will edit that record for 30 minutes just because he/she is went to drink coffee? ;)

HTH.

>Hi,
>I need help. I try to make some application using Visual Fox pro. I try using Buffering and my database is still .dbf. I still confusing about locking in buffering and manual locking.
>In manual locking i can contol my locking at record or table. And when i using table buffer, i feel i can't control locking in my table.
>ANd some times, record in one user can display in another user.
>When i update the single record which need calculate at the record, it always get wrong in my table.
>Until now i always manual locking, i realy need make my application in buffering mode, because it was more faster rather than temporary table.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform