Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking Oracle or SQL-Server records.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00396998
Message ID:
00397180
Vues:
10
>I know this subject has probably been covered before, but I can't seem to find it. If one is using VFP on the front and connecting to either Oracle or SQL-Server and desires to inform user 2 that user 1 has already retrieved a specific record, how are others here doing that without our lovely RLOCK() for VFP data?
>
>I suppose one could add a locked field to a table and set it when user 1 retrieves the record. Your process would read that as user 2 tried to retrieve the same record and indicate that it is locked.
>The problem I see in that is in the event of a crash, a module would need to run to update all lock flags back to unlocked before anyone could re-enter the app.
>
>So, what are some of the approaches to simulate a pessimistic environment for non-VFP data?
>
>Steve

You can do this in Oracle with SPT. SELECT ... FROM ... FOR UPDATE [NOWAIT]

If you do not use the NOWAIT clause, you will be in a wait state if another users has at least 1 of the records in the set locked first. use the NOWAIT clause to return a trappable error if one of the records in the set is already locked. Of course, you then have to use SPT to send updates back to the server.

If you do not, use SPT and are using remote views, you have to use an update type of Key and Modified Fields or Key and Updatable Fields and check for return errors on the TableUpdate().
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform