Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file system problems VFP9? 3

Status
Not open for further replies.

SYN

Programmer
Nov 2, 2000
45
NL
Several of our customers reported errors such as
"File is in use","File not open", "Record is in use..." etc.
It's remarkable that only those of our VFP9-pilotcustomers report this. Other customers, who have the same programs, but still working in VFP6, don't have these errors.

It seems that the filesystem release the locks very slow or something like that in VFP9.

Does anyone recognize these kind of problems and do you have suggestions?

Thanks
 
Could this be opportunistic file locking?



Regards

Griff
Keep [Smile]ing
 
No, we use the older pessimistic mode of locking as standard in our software.
 
Syn,
we use the older pessimistic mode of locking as standard in our software.

Opportunistic locking has nothing to do with the choice between optimistic and pessimistic locking. Opportunistic locking is handled on the server, and, with certain types of server, can prevent file and record locks from being successfully released.

For those users who are experiencing this problem, you should advise them to try disabling opportunistic locking, if their server system allows them to do so. This might solve the problem you are seeing (but it might also have other effects on other software the users are running, so they need to be careful with it).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I *think* Op' Locks are BOTH workstation and SERVER based, and you have to knobble (sorry turn them off) on both to be sure. Snag is, M$ in their wisdom have setup different techniques for disabling Op' Locks in each version on Windows... so you'll need to go to the M$ website to find the right one for your OS.



Regards

Griff
Keep [Smile]ing
 
Gentlemen,

you're great! It seems that vfp9 uses the Opportunistic locking from the server more than VFP6 does, although I can't proof that.
I found several knowledgebases:

But disabling the Opportunistic locking solves our problems!
Thanks!
 
Unfortunately last given solution of opportunistic locking wasn't right. Microsoft said they do see this problem occasionally where “Alias is not found” or “File is in use by another” errors, and a lot of the time it is caused by faster computers trying to access the table at the same time.

We didn't have have an ON ERROR routine to trap for these errors and in the ON ERROR trapping have the FoxPro commands SYS(1104) and RETRY so that the command that caused the error can be retried again normally resolves the problem.

ON ERROR DO act_error.prg WITH ERROR() && You can add the additional error parameters if you wish.

DO CASE
CASE get_error = 13 && This the “Alias is not found” error.
SYS(1104)
RETRY
CASE get_error = 3 && This the “File in use” error.
SYS(1104)
RETRY
CASE get_error = 108 && This is the “File is in use by another” error.
SYS(1104)
RETRY
ENDCASE

You would want to add a IF statement to maybe have the error trapping to catch the error 4 or 5 times per user so it will not get into a loop and do a RETRY a lot of times if a certain user gets hung up trying to open a table

This is tested and works great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top