Hi Thierry,
I have this new error:
Awajax.useraction() - Erreur dans l'exécution de la méthode 'annexes_scx.pageframe1.activepage= m.this.uValue' : Méthode ou procédure refresh_() : erreur n° 109 ("Record is in use by another user") à la ligne n° 7 ("REPLACE Annexesman WITH Mnb_d IN Avant_c")
In debug mode, I have no error.
Thanks in advance
This error occurs probably because 2 COM servers attempt to lock the same record of the avant_c
table.
FWIW, VFP automatically locks some or all records when executing commands such as APPEND
, REPLACE
, etc. (see 'locking data' in VFP9 help)
Make sure to use such command only when useful, and narrow the scope as much as possible: eg. avoid REPLACE ALL
that locks all records in the table.
Also make sure to set reprocess
to a suitable value.
The FoxInCloud Error Analyzer (/wc.wc?FoxInCloud~wFrmLogError) can also help you understand the context when the error occurs:
https://www.dropbox.com/s/h4il0yo1h1mqi53/Capture%20d%27%C3%A9cran%202019-07-31%2017.10.54.png?dl=0
Yes, but the message appears systematically and the REPLACE is done only on a record.
And why would this behavior be different in debug mode ?
I have bypassed the problem but I do not understand the cause.
This happens because, when the replace
attempts to execute, it finds a lock set on the record by another VFP process, probably another FoxInCloud COM server, or a table maintenance routine if any.
Debug mode runs only one VFP process (the VFP IDE) so there's no chance a record lock contention may happen.
ok, thanks for the explanations
Hi Thierry,
I have this error again, when replacing a memo field.
It can't be due to opening the table in two different instances, because I'm replicating in localhost.
With a suspend, I find that the record does not support any modification (replace, blank or via a browse). UNLOCK() does not change anything.
The specific message is:
error #109 ("Record is in use by another user") on line #22 ("set &tcSetting &tvValueNew")
Do you have an idea and what can I send you to help me?
Not reproducible in development mode
Hi Vincent,
I'll dig into this issue shortly
By changing the order of loading my tables, the error disappeared. I'll keep you posted ...
Also see the set reprocess
command
A record lock is a pretty clear error message if you ask me. You have a problem with multiple user/applications accessing the same file/record. This could also be due to log or session files in Web Connection or FIC.
As others have suggested, start by SET REPROCESS TO 2 seconds
(or whatever is appropriate) so it applies globally and across all data sessions - you should do that anyway, for any type of application that has potential for multi-user access. Chances the Record is in use error just goes away.
A Web Connection application is basically a multi-user application if you run more than a single instance. You'll never see this problem in development because you're not running multiple instances in dev.
+++ Rick ---