Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
The simplest way to handle this issue is through a semaphore locking scheme. Add a table to your database that holds the name of the table and the PK of the record you wish to lock. Then, create a 2 stored procedures: one to check to see if you can get a lock and the other to unlock. The lock proc simply checks to see if a record in the locktable already exists. If it does, the proc will return -1. If the record does not exist, the proc will add a record and will return 0. The unlock proc simply deletes the record from the lock table.
This scheme has some limitations. Most notably, if other apps write data to the database, they too will need to use the stored procs. This is why I suggest using stored procs as opposed to using Fox code to see if you can lock a record.
>If I'll be using RVs in manipulating SQL Data, how to lock a record so that it can not be edited by anyone and then release the lock afterwards to make it available for editing?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement