Re: [WebDNA] Re: exclusivelock

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107021
interpreted = N
texte = reply at the bottom (good to look there in general, even though we are = not in the habit of bottom posting on this list) > Basically, as long as a lock can be acquired, the interior WebDNA > will be executed.. a test like this: >=20 > ---------------- > [Exclusivelock db=3Dsome.db] > [loop...] > Searching (or other) that keeps some.db busy for a few minutes. > [/loop] > [/Exclusivelock] >=20 > Then in another browser, try to do something to some.db. > ---------------- >=20 > will result in the second hit waiting until the code within the = exclusivelock is finished. >=20 > ---------------- > [loop...] > Searching (or other) that keeps some.db busy for a few minutes. > [/loop] >=20 > Then in another browser, try to do something to some.db. > ---------------- >=20 > In the immediately above example, the hit in the second browser will = not wait. >=20 > 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. >=20 > 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. ;-) Thanks Donovan! In the OP, Grant Hulbert was telling the OP to check for windows = antivirus software as the culprit that was causing "..deadlock..." error = msgs. when webdna code was trying to access a db. He said, " > Yes, antivirus software on Windows is notorious for grabbing exclusive = file locks on large files, and even worse: the scan gets triggered every = time the file is modified. Turn off virus scanning for db files, because = those are not executables anyway. >=20 > Also, best to wrap an [ExclusiveLock]...[/ExclusiveLock] around the = outside of all that visitor-counter code, because all it takes is two = visitors to hit the site simultaneously to cause the DB to deadlock. = You'll run into this on any multithreaded programming language. " ...which tempts us to feel satisfaction in letting our minds rest (that = we now think we know how to use [ExclusiveLock]...[/ExclusiveLock]; that = his explanation is in congruity with what you wrote), *except* that his = message seems to imply that the [ExclusiveLock]...[/ExclusiveLock] = wrapper would *PREVENT* a deadlock in the case the OP was facing, rather = than what you are saying which seems to be that the use of = [exclusivelock] (apart from having value in forcing webdna to wait until = some db-operation is done before being able to touch the db again) = might *CAUSE* a deadlock in the case the OP was facing. Or am I missing something in my understanding in what you, or Grant, = are saying? Anyone please feel free to chime in if I am too dense this morning, = thanks, -Govinda Associated Messages, from the most recent to the oldest:

    
  1. [WebDNA] exclusivelock (Kenneth Grome 2011)
reply at the bottom (good to look there in general, even though we are = not in the habit of bottom posting on this list) > Basically, as long as a lock can be acquired, the interior WebDNA > will be executed.. a test like this: >=20 > ---------------- > [Exclusivelock db=3Dsome.db] > [loop...] > Searching (or other) that keeps some.db busy for a few minutes. > [/loop] > [/Exclusivelock] >=20 > Then in another browser, try to do something to some.db. > ---------------- >=20 > will result in the second hit waiting until the code within the = exclusivelock is finished. >=20 > ---------------- > [loop...] > Searching (or other) that keeps some.db busy for a few minutes. > [/loop] >=20 > Then in another browser, try to do something to some.db. > ---------------- >=20 > In the immediately above example, the hit in the second browser will = not wait. >=20 > 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. >=20 > 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. ;-) Thanks Donovan! In the OP, Grant Hulbert was telling the OP to check for windows = antivirus software as the culprit that was causing "..deadlock..." error = msgs. when webdna code was trying to access a db. He said, " > Yes, antivirus software on Windows is notorious for grabbing exclusive = file locks on large files, and even worse: the scan gets triggered every = time the file is modified. Turn off virus scanning for db files, because = those are not executables anyway. >=20 > Also, best to wrap an [exclusivelock]...[/ExclusiveLock] around the = outside of all that visitor-counter code, because all it takes is two = visitors to hit the site simultaneously to cause the DB to deadlock. = You'll run into this on any multithreaded programming language. " ...which tempts us to feel satisfaction in letting our minds rest (that = we now think we know how to use [exclusivelock]...[/ExclusiveLock]; that = his explanation is in congruity with what you wrote), *except* that his = message seems to imply that the [exclusivelock]...[/ExclusiveLock] = wrapper would *PREVENT* a deadlock in the case the OP was facing, rather = than what you are saying which seems to be that the use of = [exclusivelock] (apart from having value in forcing webdna to wait until = some db-operation is done before being able to touch the db again) = might *CAUSE* a deadlock in the case the OP was facing. Or am I missing something in my understanding in what you, or Grant, = are saying? Anyone please feel free to chime in if I am too dense this morning, = thanks, -Govinda Govinda

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:

[url] issue (2000) Security Tip (1996) Dark Horse Comics success story (1997) Upgrade to web DNA6.0 (2004) WebCatalog on G3 Macs? (1997) [taxRate] [TaxTotal] ? (1997) authenticating a second user (1997) [WebDNA] writing pdfs on the fly (Avery labels #5160) (2010) ShipCosts database (1997) Only charge card when product shipped ? (1997) [WebDNA] encoding with webdna/JS, in context of various file encodings/charsets (2010) How to find 100 most recent additions. (1997) Re1000001: Setting up shop (1997) Multiple prices (1997) Adding discount to cart (2000) [shownext max (1997) Wait, I forgot something! (was authenticating a seconduser, the sequel) (1997) WebCat editing, SiteGuard & SiteEdit (1997) Too many database headers? (2003) WebCat2: Items xx to xx shown, etc. (1997)