Re: [WebDNA] Re: exclusivelock

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107022
interpreted = N
texte = How is the lock actually acquired? Must the database be open before the lock can be acquired? If the db is not open when exclusivelock attempts to acquire a lock, will the exclusivelock context open the db so that it can acquire a lock? --------- If using exclusivelock opens the db, or if the db is already open when the lock is acquired, will the db remain open throughout the entire time the code inside the exclusivelock context is being processed? Or can the db be closed and reopened as many times as necessary -- within the exclusivelock context -- WITHOUT releasing the lock? Or does a closedatabase tag inside the exclusivelock context force the lock to be released -- because the lock cannot be maintained if the db is closed? Or does a closedatabase tag inside the exclusivelock context FAIL TO CLOSE THE DB because the exclusivelock context forces the db to remain open? Sincerely, Kenneth Grome > Kenneth Grome wrote: > > I'm saying I don't know how exclusivelock actually > > works, and I don't know what issues we should (or > > must) keep in mind when using it. > > > > Sincerely, > > Kenneth Grome > > I have to admit that I didn't read this thread initially > because it is a pet peeve of mine when people can't hit > the "new message" button (instead of *replying* to > someone's thread with their *new topic*)... So I don't > know what was said already, but I think the docs spell > it out pretty well, specifically it's intended purpose. > > Basically, as long as a lock can be acquired, the > interior WebDNA will be executed.. a test like this: > > ---------------- > [Exclusivelock db=some.db] > [loop...] > Searching (or other) that keeps some.db busy for a few > minutes. [/loop] > [/Exclusivelock] > > Then in another browser, try to do something to some.db. > ---------------- > > will result in the second hit waiting until the code > within the exclusivelock is finished. > > ---------------- > [loop...] > Searching (or other) that keeps some.db busy for a few > minutes. [/loop] > > Then in another browser, try to do something to some.db. > ---------------- > > In the immediately above example, the hit in the second > browser will not wait. > > As for deadlocks, I don't know the inner workings of > WebDNA well enough off the top of my head to tell you > exactly what goes on, but I seem to remember some > mechanism to deal with deadlock possibilities native to > the WebDNA database engine (separate from > Exclusivelock).. but I could be wrong. > > For what it's worth, I started using Exclusivelock many > years ago for situations such as described above... > which is what the docs say it's purpose is for. However, > I could see how using [Exclusivelock ..] would be an > extra firewall against deadlocks as well... obviously, > you can't have a deadlock if no other threads are > accessing the file. ;-) > > Hope that helps. > Donovan > > P.S. Please hit the "new message" button! ;-) Associated Messages, from the most recent to the oldest:

    
  1. [WebDNA] exclusivelock (Kenneth Grome 2011)
How is the lock actually acquired? Must the database be open before the lock can be acquired? If the db is not open when exclusivelock attempts to acquire a lock, will the exclusivelock context open the db so that it can acquire a lock? --------- If using exclusivelock opens the db, or if the db is already open when the lock is acquired, will the db remain open throughout the entire time the code inside the exclusivelock context is being processed? Or can the db be closed and reopened as many times as necessary -- within the exclusivelock context -- WITHOUT releasing the lock? Or does a closedatabase tag inside the exclusivelock context force the lock to be released -- because the lock cannot be maintained if the db is closed? Or does a closedatabase tag inside the exclusivelock context FAIL TO CLOSE THE DB because the exclusivelock context forces the db to remain open? Sincerely, Kenneth Grome > Kenneth Grome wrote: > > I'm saying I don't know how exclusivelock actually > > works, and I don't know what issues we should (or > > must) keep in mind when using it. > > > > Sincerely, > > Kenneth Grome > > I have to admit that I didn't read this thread initially > because it is a pet peeve of mine when people can't hit > the "new message" button (instead of *replying* to > someone's thread with their *new topic*)... So I don't > know what was said already, but I think the docs spell > it out pretty well, specifically it's intended purpose. > > Basically, as long as a lock can be acquired, the > interior WebDNA will be executed.. a test like this: > > ---------------- > [Exclusivelock db=some.db] > [loop...] > Searching (or other) that keeps some.db busy for a few > minutes. [/loop] > [/Exclusivelock] > > Then in another browser, try to do something to some.db. > ---------------- > > will result in the second hit waiting until the code > within the exclusivelock is finished. > > ---------------- > [loop...] > Searching (or other) that keeps some.db busy for a few > minutes. [/loop] > > Then in another browser, try to do something to some.db. > ---------------- > > In the immediately above example, the hit in the second > browser will not wait. > > As for deadlocks, I don't know the inner workings of > WebDNA well enough off the top of my head to tell you > exactly what goes on, but I seem to remember some > mechanism to deal with deadlock possibilities native to > the WebDNA database engine (separate from > Exclusivelock).. but I could be wrong. > > For what it's worth, I started using Exclusivelock many > years ago for situations such as described above... > which is what the docs say it's purpose is for. However, > I could see how using [Exclusivelock ..] would be an > extra firewall against deadlocks as well... obviously, > you can't have a deadlock if no other threads are > accessing the file. ;-) > > Hope that helps. > Donovan > > P.S. Please hit the "new message" button! ;-) Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCat2b13MacPlugIn - [showif][search][/showif] (1997) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) [OT] HTML EMAIL program wanted (1999) using listfiles to build a database? (2000) Database (2002) Summ=T Problem (1997) forms and variables (1998) Bad Cookie (1998) A Global Variable (1997) Fun with dates (1997) Running 2 two WebCatalog.acgi's (1996) WebCat B13 Mac CGI -- Frames question (1997) WebCatalog can't find database (1997) A little syntax help (1997) WebCatalog can't find database (1997) If Empty ? (1997) Using a database with a short url (2000) Bug Report, maybe (1997) ListVariables Problem (2003) help with autenticate (1998)