Does wwBusiness "error 108 - File is in use by another user" mean I have to repair the dbf, or does it mean I should:
SET TABLEVALIDATE TO 0 or SET TABLEVALIDATE TO 2
It appears to happen when selecting an already open table here: IF USED(lcAlias) SELE (lcAlias) ELSE
No, the error message means that the table is used Exclusive somewhere in your code, or by someone else.
Make sure that you have Set Exclusive Off
early in your code.
I've got that covered, thanks... Exclusive is off and no file locking. Something else is going on.
Are you really sure there's not something else keeping the file open? Some other application that's hung perhaps? Or another user logged into your machine?
This is not a VFP file locking error but that looks like the lower Windows error is being triggered.
+++ Rick ---
There may be an RLOCK() going on in wwbusiness but that wouldn't prevent a USE from another instance - would it?
I'll have to figure out how to check the status of other instances when this happens... or maybe change to a try/catch to retry a few times before it errors out...??
For locking issues I use:
SET REPROCESS TO 2 SECONDS
to ensure that any table lock that is quick won't break the app. It's rare that anything takes more than 2 seconds on the Db, much less anything that needs to lock the table.
An RLOCK()
won't hold up a USE
statement though, but may affect write operations. Lock errors throw a different exception though - there are specific error messages that say that there's record or table lock, so I don't think that's what's happening in your case.
As Tore points out file is in use
errors are either caused by EXCLUSIVE use of a table by another user, or by bona fida open file from another application that is somehow locking it (ie. not a FoxPro lock, but some other OS lock).
It could also come from a low level file operation or copy operation. That errors can be very broad.
+++ Rick ---