Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Semaphore lock?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Titre:
Divers
Thread ID:
01658623
Message ID:
01658627
Vues:
45
>>Hi,
>>
>>I am working on implementing a semaphore locking so that the same record (in VFP 9 application with SQL Server) cannot be edited at the same time by more than one user. I think I have a draft design using a .DBF table for semaphore locking. The nice thing about a DBF table is when a user locks a record and then closes the application, the record will be automatically un-locked (I think after some set time).
>>
>>Is there a feature in SQL Server where the same can be done? That is, if I create a table in the SQL Server for "locking" or indicating that a user is working on this or that order, can the record/row be automatically un-locked if user closes the app?
>>
>>TIA
>

>Take a look at https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-getapplock-transact-sql

If you found think link with Google and have not used this method, you can ignore my question.

The following Remark from the link is not clear to me.
Locks placed on a resource are associated with either the current transaction or the 
current session. Locks associated with the current transaction are released when the 
transaction commits or rolls back. Locks associated with the session are released 
when the session is logged out. When the server shuts down for any reason, 
all locks are released.
What is current session? That is, if a user of the application creates this applock, will it be recognized by another user (from another PC or whatever)?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform