Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scatter/Gather vs. Buffering?
Message
 
To
21/05/1999 23:36:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00220482
Message ID:
00221748
Views:
31
John,

Not quite that simple but along those lines. When I need the pessimistic locking strategy (which I find is seldom) I use a semaphore locking technique that never secures a lock on the table actually being edited (except durng the actual writing to disk).

I have a semaphore table in which I store the table's name, the record number, the user ID, and the datetime of the lock. The record in the semaphore table is actually locked as well. When someone tries to start an edit, I search for a record in the semaphore table that matches the table and record. If I find one there I try to lock it (if I can lock it then the other user has left the system so their lock was released) if I can't lock the semaphore record I tell the current user who has the record and when they got it.

Once an edit is finished, I unlock and delete the record in the semaphore table.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform