Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record is in use by another user.
Message
From
02/10/1997 16:11:06
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
To
01/10/1997 13:19:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00052443
Message ID:
00052937
Views:
47
>
>I have changed all the APPEND code to INSERT INTO. I have also changed the stored procedure code to read:
>
>IF SEEK(lcAlias, "idnums", "table")
> IF RLOCK()
> lnID = idnums.nextid
> REPLACE idnums.nextid WITH idnums.nextid + 1
> REPLACE updated with datetime()
> UNLOCK
> ELSE
> MESSAGEBOX("Idnums record is locked by another user. Record could not be added to " + lcalias,48+0+0,"Update Error")
> ENDIF
>ELSE && Table name was not found in idnums table. Create a new record and initialize it to 1
> APPEND BLANK
> REPLACE table WITH lcalias
> REPLACE nextid WITH 1
> REPLACE updated with datetime()
> lnID = idnums.nextid
>ENDIF
>
>This has done nothing to help my problem. As of 11:00 am this morning, we have received the "Record is in use by another" error 14 times. Sometimes on one table, sometime on another. (The save routine adds records to 2 different tables).
>
>The problem is directly coordinated with our network performance problems, which in the past, up until now have been bothersome but tolerable. I can't help but think that the network problem has just served to expose a weakness already existent in the program, but I feel like I have done everything by the book. I will be calling MS soon if I can't get the problem solved here. Thanks for any more insight that you can give.

Try changing the code to
STORE ALIAS() TO m.LastArea
SELECT idnums
IF SEEK(lcAlias, "idnums", "table")
IF RLOCK()
lnID = idnums.nextid
REPLACE idnums.nextid WITH idnums.nextid + 1, updated with datetime()
UNLOCK
FLUSH
ELSE
MESSAGEBOX("Idnums record is locked by another user. Record could not be added to " + lcalias,48+0+0,"Update Error")
ENDIF
ELSE && Table name was not found in idnums table. Create a new record and initialize it to 1
store lcalias to m.table
store 1 to m.nextid,InID
store dateteim() to m.updated
INSERT INTO idnums FROM MEMVAR
UNLOCK
FLUSH
ENDIF
SELECT (LastArea)

1) Your RLOCK() may or may not have locked the IDNUMS table. What if you had currently been selected in another area? To ensure your RLOCK() should have been RLOCK("idnums') and UNLOCK IN idnums

2)Put as many REPLACE statements on a single line, it is much faster to process all at the same time.

3) Use the INSERT when ever possible

Let me know if this helps. I think that the problem may have been related to item #1
L.A.Long
ProgRes
lalong1@charter.net
Previous
Reply
Map
View

Click here to load this message in the networking platform