Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking a Record
Message
De
09/09/2014 13:59:12
 
 
À
09/09/2014 12:53:19
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01607215
Message ID:
01607219
Vues:
51
>I need to retrieve a record out of a queue, and I want to lock it to make sure that only one user retrieves and is working on a record at a time.
>
>I don't think this is a complicated concept, but I've never done it before. Can somebody give me a crash course on what I'm looking for? I'm going to have a status on the record of Pending/Done I think to explicitly mark that the record has been processed, but I need to work on the locking part. This is the requirement that was provided to me:
>
>This action must be safe across multiple webservers, meaning no 2 users could possibly receive the same row at the same time (atomic operation? Cross-database locking?)

In SQL Server (and I'm assuming since you posted this in SQL Server that we're talking about SQL Databases), you don't have the same rlock() and flock() that you have in VFP.

In SQL (and other big DBs) you have isolation levels that implement shared locks (for reading) and write locks (for writing)

I'm going to type out some notes here in a few minutes that might help
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform