Lock errro
Posted: Wed May 11, 2011 7:01 am
Roger,
We have a stand-alone exe that runs on one of users server (win2003). No client server.
This process downloads data (mobile locations, messages,etc) from a web site 24/7. The files that are updated are fairly large, 50,000-500,00 records. Never a problem on these files. About 30-50 times daily there are special routines to update other files which are very small. One is driving us crazy. 130 records, its driver hours used the prior day. When the messages come in, we open the file, find the driver record, lock it, update, unlock it and close it. There is a lock error almost every day on one of these, even though the lock routine is successful. Just says lock is required for this operation and the exe locks up. The user is getting very upset at this as the exe stops running until they cancel and restart it.
This is our record locking routine..used now for 8 years. There is no alert message, so the lock had to be successful.
FUNCTION OISRCLCK
LOCAL XLOCK
XLOCK=.F.
DO WHILE .NOT. ( XLOCK := RLOCK() )
n := DC_GuiAlert(,"Unable to lock record #" + LTRIM(STR(RECNO())) + IF(EOF()," (EOF) ","") + " of " + ;
IF( !EMPTY(ALIAS()),UPPER(ALIAS())," Work Area #" + LTRIM(STR(SELECT())) ) + ". ;" + ;
"Procedure " + UPPER(PROCNAME(0)) + " -- line " + LTRIM(STR(PROCLINE(0),5)) + ";" + ;
"Procedure " + UPPER(PROCNAME(1)) + " -- line " + LTRIM(STR(PROCLINE(1),5)) + ";" + ;
" " ,{ "Retry", "Quit" } ,14,"Error Warning",,,{"9.Arial Bold","9.Arial Bold" })
if n=2
return .f.
else
loop
endif
ENDDO
RETURN .t.
Any recommendations?
Thanks
Fred Henck
omni
We have a stand-alone exe that runs on one of users server (win2003). No client server.
This process downloads data (mobile locations, messages,etc) from a web site 24/7. The files that are updated are fairly large, 50,000-500,00 records. Never a problem on these files. About 30-50 times daily there are special routines to update other files which are very small. One is driving us crazy. 130 records, its driver hours used the prior day. When the messages come in, we open the file, find the driver record, lock it, update, unlock it and close it. There is a lock error almost every day on one of these, even though the lock routine is successful. Just says lock is required for this operation and the exe locks up. The user is getting very upset at this as the exe stops running until they cancel and restart it.
This is our record locking routine..used now for 8 years. There is no alert message, so the lock had to be successful.
FUNCTION OISRCLCK
LOCAL XLOCK
XLOCK=.F.
DO WHILE .NOT. ( XLOCK := RLOCK() )
n := DC_GuiAlert(,"Unable to lock record #" + LTRIM(STR(RECNO())) + IF(EOF()," (EOF) ","") + " of " + ;
IF( !EMPTY(ALIAS()),UPPER(ALIAS())," Work Area #" + LTRIM(STR(SELECT())) ) + ". ;" + ;
"Procedure " + UPPER(PROCNAME(0)) + " -- line " + LTRIM(STR(PROCLINE(0),5)) + ";" + ;
"Procedure " + UPPER(PROCNAME(1)) + " -- line " + LTRIM(STR(PROCLINE(1),5)) + ";" + ;
" " ,{ "Retry", "Quit" } ,14,"Error Warning",,,{"9.Arial Bold","9.Arial Bold" })
if n=2
return .f.
else
loop
endif
ENDDO
RETURN .t.
Any recommendations?
Thanks
Fred Henck
omni