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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View and "Attempting to lock" message. Please Help!!! 1

Status
Not open for further replies.

parslej

Programmer
Nov 21, 2001
40
PL
I use one view on my form. I set "private datasession". When I run program in network program often hung up (then user can see message "Attempting to lock, press ESC...") and nothing is happen...

I thing that view only read record from base table(s) so I don't understand this message...

PLEASE HELP ME if you know what I should do...
 
Ji

1. Have you SET EXCLUSIVE OFF ?
2. Is anyone else opening the same table in exclusive way ?
3. even if exclusive is set OFF, if you ..
USE myTable EXCLSUIVE this can conflict.

You can check these and rectify :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
tnx for quick reply...

1. I have in my main.prg SET EXCLUSIVE OFF
2. No all users open tables in not exclusive way...

I have this problem only with my view... (This message appear in moment when view is created)

Any conception ?
 
When accessing a View the record in the DBC (where the definition is stored), is actually Locked, which can cause the "Attempting to lock, press ESC..." message to the next user. Many developers have found that frequently accessed Views are better handled by creating a "local" DBC for each user that just holds the required View(s).

Rick
 
Many thanx for response!

What do you mean: 'local' DBC for each user?
Should I create new database with all users who are working with my app ?


Is it not suffice to create new view with the same SQL query?

 
The following is from the Fox Wiki ( the first is part of a discussion on "the" problem (at and then the link at the end will point you to a solution (like creating a local copy of the View to prevent the locking).

"Multiple users opening RV’s simultaneously creates a contention, limiting scaling
TRUE


With VFP3, RVs could not be altered unless opened exclusively.
With VFP5 and subsequent, RV’s can be altered at any time. This created a risk that a View definition might change while the view is being opened. For this reason the view header record is "locked" until the view is fully open. This locking means that only one user can open any given View at a time. If timeout occurs a "Database object in use" error may be seen. Some developers have seen this in larger systems.
This issue is a significant design flaw and a limitation to RV scaling.
As the locking mechanism is a poor technique it is hoped that this will be replaced with a hashcode or similar mechanism in future versions of VFP.
In the interim, developers have devised mechanisms such as importing view definitions to a local temporary database. This is well described elsewhere in the WIKI."


Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top