Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange locking problem
Message
From
03/05/2004 08:08:33
 
 
To
03/05/2004 07:31:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00900300
Message ID:
00900332
Views:
14
Hmmm, thanks, hadn't considered that. Might also explain an intermitent problem I have elsewhere.

In this instance I had thought that both the log file and the control file which holds 'Next ID' were neither record nor file 'locked' in the application that is freezing up. However, I have just discovered that an assumption that I had about ISFLOCKED() being able to detect whether a file has been locked by another app is incorrect so I will need to investigate further

The behaviour appears to be the same as encountering a locked record but as I said earlier, I can open the table in shared mode using VFP and append, change, delete records as I wish. If I open another instance of VFP and lock the table I can no longer do this. Yet if I close the table in app#1 and I have multiple app#2's frozen everything continues as it should.

Both tables are 'free' tables, there is no buffering and no transactions.

I will try some more combinations in the morning.

Once again thanks
Geoff


>*IF* the 2 different applications in question both lock more than the log table to do their work, then you may be encountering a 'deadly embrace'.
>
>A 'deadly embrace' happens when app#1 locks (record(s) of) fileA, then fileB and another app locks in fileB then FileA. A single app most likely always locks all records in the same sequence, thus no problem. But if some other app uses some other sequence then you stand a chance of a deadly embrace. App#1 has a lock on fileA and needs fileB but app#2 has fileB locked and needs fileA.
>
>good luck
>
>
>>Hi
>>
>>I have an application where several instances of a program may be running at the same time. They all write to the same log table. If another executable, which also has the log table open ,is also running on the computer at the same time, inserts a record into the log table are somehow stopped until I exit that program.
>>
>>The strange thing is that I can open the table via the VFP IDE and add/delete records as I like. I have put debug messageboxes in the program and they show that the table is not locked yet the program hangs at the insert command (The problem doesn't happen if I am using the debugger)
>>
>>Has anyone any idea why this might be occuring?
>>
>>Regards
>>Geoff Scott
May all your weeds be wildflowers
Previous
Reply
Map
View

Click here to load this message in the networking platform