Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to simulate RLock() in Ms SQL 2008
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Application:
Desktop
Miscellaneous
Thread ID:
01520541
Message ID:
01520548
Views:
33
>>Hello,
>>
>>In our VFP applications, when working with DBF tables, we sometimes used RLOCK() to lock a certain record in order to check the state of things, like for example if a user is logged in, we lock the record of the user in a session table, and then can check which records are locked, knowing which users are logged in. (When the user logs out, or if they lost connection with the server or the program crashes, the lock would eventually get released).
>>
>>What is the best way to simulate this functionality in SQL Server?
>>
>>Thanks in advance!
>
>I guess it depends on what you're actually trying to do. If it's how to deal with update conflicts this might help: http://www.jamesbooth.com/conflicts.htm

Yes, it's not so much about update conflicts, but about creating a lock that can be checked in the database if another user is online, or has a certain operation running. You could do that with simply setting a flag in a field somewhere, and resetting the value when the operation has ended, but if the client looses connection that flag would never get reset. A lock would get reset automatically and is the best solution in those cases I believe.
Christian Isberner
Software Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform