General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>I am seeking information on the possibility of a deadly-embrace situation occuring with SET REPORTESS TO -1.
>
>For example, user 1 locks files A then B. User 2 attempts to lock B then A at the same instant. The first lock executed by each user succeeds and flock() returns. When trying to lock the second file, the lock does not succeed because A and B are both locked.
>
>Is this a problem with VFP? If not, why not? Does the lock manager on the server account for this possibility, or is it just a very high statistical improbability? If it is a problem, what are some solutuions?
>
>Thanks, Dennis Hevener
Yes it would be a problem, and you have defined it well. There are a number of ways to sense it hapening and recover from it, but I like a proactive approach - don't let it happen in the first place.
What I do when I need to lock two or more files is to lock them in alphabetical order. As long as I'm consistant throughout the system, deadly embrace can't happen. Alphabetical is just one way, any order that you prefer (as long as you are willing to stick to it) will do.
This is certain to be inconvenient in some situations, but taken as a general rule it should keep you out of trouble.
Bob
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only