Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC in pessimistic mode
Message
From
03/11/1997 15:57:54
 
 
To
03/11/1997 10:44:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00057793
Message ID:
00058044
Views:
29
>I only know about one backend -- SQL Server. In that case it is impossible to get a record lock, you can only get page locks. So, you must resort to using a "logical lock". That entails adding a column which holds the "locked" value. When the user gets a record to edit, you check the current value of the locked column -- if it is locked by someone else, deny the edit, if it is not locked, change the value to locked and give the user the opportunity to edit. I have implemented this strategy in one of my client-server apps and it works well. Oh, BTW, I have a stored procedure on the back end that compares the user ID in the Locked column with the ID's of all users logged in. If there is no match, I clear the Locked column. The stored procedure runs every 5 minutes or so (gets rid of those locks still holding on if the user just turns off the computer and goes home). I also make sure to clear all locks in the shut-down procedure.

Ok, this is the technique we are focusing on. But, there is a problem with that. How can we be sure that 2 persons won't attempt to lock it at the same time? This is where a RLOCK() similar way of doing things is needed. Also, in our case, we will have different backends. In addition to finding a secure way of making sure not 2 persons get the record at the same time, we also need a mecanism that will work for all.

Thanks.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform