Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to lock mssql record from foxpro
Message
From
30/10/2003 04:31:24
 
 
To
29/10/2003 14:30:59
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00844247
Message ID:
00844420
Views:
22
Hi Ricky,

on SQL Server is possible lock a record ( pessimistic mode ),
but for do this,
you need have a
- transaction open
- use SET LOCK_TIMEOUT
- lock the primary key index with a Select hints
- build a lock handling engine on VFP

The only hard point is this:
SQL Server have a lock escalation ( for reduce the memory overhead ),
this is out of programming control;
if SQL apply a lock escalation, you can give a lock on rows that you donnot
lock, this characteristic reduces the sharing, but it does not create incoherence problems.

Is complex, but is possible ( i implement it ).

Another way is this:
build a ##MUTEX_TABLE, and implement the rows locking using
READUNCOMMITTED, READPAST, READCOMMITTED hints on this global temp table;
you need apply the mutex concept to this table.

This is more simple, but you need to implement all the lock mechanism:
tons of triggers !!

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform