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!

I have a recurring problem when inserting items into a table using VFo

Status
Not open for further replies.

simo

Instructor
Dec 5, 2000
18
US
I have a recurring problem when inserting items into a table using VFox 6, using Novell as the Network OS.

At seemingly random intervals, the system crashes with a FILE 108(file is in use by another user) error.

I am simply using the INSERT INTO command, with a table that is already open, so it seems strange that I get this error.

I was wondering if anybody else had come across this problem and knew of a solution?

Regards
Simon [sig][/sig]
 
The error message implies that either someone else has the file open exclusively, or the current user is trying to open it exclusively. Double-check that the application, including the CONFIG.FPW file, is using SET EXCLUSIVE OFF and the code is not trying to open a file exclusively with USE MyTable EXCLUSIVE. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
I don't think that this is the problem really, because the file is opened at the beginning of my program (and it is shared) and then written to often by my program - so I am not trying to open it, and because it is already open, it cannot be in use by another user exclusively as I would get a file access denied error when trying to open it - this is why it is a strange problem, I have heard reports of it being caused by contention, i.e.,the network os reporting information back to the program b4 it is really ready, and therefore causing problems, and I have heard that SET REPROCESS quite high (say 10 secounds) can solve it (although not in my case). [sig][/sig]
 
Another user could have a file or header lock. For example, one user executes an INSERT command a nanosecond before user #2. User #1 will, for a brief moment, receive an automatic record lock on the new record, and because it is a new record, a lock on the DBF header. This header lock would prevent anyone else from doing anything that affected the header (such as inserting a record).

In your error routine, try trapping for ERROR()=108, and setting up a 3-count loop, with a WAIT &quot;&quot; TIMEOUT .5 in between and retrying each time within the loop. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
That sounds like a good suggestion, I will try it, thanks for your help!

Regards

Simon [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top