PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WD8 - Who or what frees locks?
WD8 - Who or what frees locks?
Débuté par Stephan Wiestner (Swissstephan), 10 mai 2006 12:27 - 4 réponses
Posté le 10 mai 2006 - 12:27
Hi to all
Starting to develop in multiuser/server environment, I have problems over problems.
My app installed on a client with datafiles on the local disc runs smooth, okay quite smooth.
Having the datafile on a server, only strange things are happening.
The file, which i read with "hlockwrite", produces a "Standard lock error", but there is still only one user.
Probabely, it's because I never use "HunlockRecNum" since I was used, that writing/modifying the locked record will free it again. Am I wrong? Do I have to use "HunlockRecNum"?
Which brings me to my second problem. Using "HunlockRecNum" in a transcation produces some more than strange behaviour, it looks like it produces a Transaction Cancel.
Can anyone help me with my two problems? Thanks a lot
Posté le 11 mai 2006 - 12:58
Hi,

If your server is runing on Novell, you have to define the flag "Sharable" on the files.

@+, JF
Posté le 11 mai 2006 - 17:30
Hi Stephan,
as an answer on your first question: No, you're not wrong. After HAdd() or HModify() you don't have to use HUnlockRecNum(). The locked (only with HModify()) record is unlocked by HModify().
I can't help you with your second question, I never used transactions.
Regards, Stefan.
Hi to all
Starting to develop in multiuser/server environment, I have problems over problems.
My app installed on a client with datafiles on the local disc runs smooth, okay quite smooth.
Having the datafile on a server, only strange things are happening.
The file, which i read with "hlockwrite", produces a "Standard lock error", but there is still only one user.
Probabely, it's because I never use "HunlockRecNum" since I was used, that writing/modifying the locked record will free it again. Am I wrong? Do I have to use "HunlockRecNum"?
Which brings me to my second problem. Using "HunlockRecNum" in a transcation produces some more than strange behaviour, it looks like it produces a Transaction Cancel.
Can anyone help me with my two problems? Thanks a lot
Posté le 14 mai 2006 - 11:20
G'day Stephan
An alternative would be to only use manual locking where absolutely essential - ie incrementing an order number counter or similar - and for all other file operations let Windev do the locking in automatic mode. You can turn this on in the Project Description > Files.
In relation to the transactions, I do not use them but I would imagine that locking or unlocking a file engaged in a transaction must break the transaction functionality because it would then be unable to roll back the transactions.
Regards
Al
Posté le 15 mai 2006 - 16:17