Re: Same DB Same Time

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 55949
interpreted = N
texte = On 2/9/04 11:57 AM, "Justin Carroll" wrote: The reason it works when its on one page is that webdna working from top to bottom accesses the functions in a specific order. However, by spreading the process over multiple tpl documents, you throw that order to the wind. The second frame may or may not get in between the append thus causing your number to be out of whack. To webcatalog, these pages are no different than 2 different people on two separate pages trying to do similar things at once (or nearly so). This points to flaws in the logic of how you handle your numbering scheme. I would recommend that you adopt a seed based numbering system based on time and a random extension. Even with time you will get 2 processes hitting in the same second and you can have trouble. Now usually this is very rare, but when you are putting these all on one page yet through multiple frames you increase your likelihood of same second attempts. The problems is not that WebDNA isnt 'buffering' things correctly, but rather the timing of your events is not constant based on multiple frames hitting in different sequences. To get around that you really need to figure out where the logic problem lies (perhaps just the numbering) and either adopt a new logic to overcome this, or stop hitting the system in the fashion you are. Sorry, no slams here, but it seems that the logic change is the only sure fire way to get around the issue these timings are causing for you. HTH Alex > I have two iFrames on a page. Both of the iFrame's src is the same. It is a > .tpl page that does a [replacefounditems] on one database and an [append] on > another database. > > The [replacefounditems] pulls an integer from the database, increases it by > one, and then replaces the old value. The [append] creates a new sku by > grabbing the highest integer and increasing it by one (basically an > autonumber). > > Sometimes this all works just fine with the same .tpl firing at the same time, > accessing the same db at the same time and updating at the same time; however, > sometimes it does not. In the case that it does not, I get duplicate skus and > the integer that is supposed to be updated by the [replacefounditems] does not > update. > > I've tested this numerous times (a lot). It acts like the two statements fire > and collide with each other. Or that one isn't commiting in time for the > other statement to realize anything has changed in the database. It seems like > WebDNA should have some sort of buffer for accessing the same database at the > same time. > > I've wrote the talk list about this problem before and haven't come up with > any great solution. I'd like to give this another whirl and see if we can't > find something. Please help. Thanks. > > Justin Carroll > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ Alex J McCombie New World Media Chief Information Officer Box 124 888/892.6379 MartVille, NY 13111 Alex@NewWorldMedia.com http://OurClients.com Interface Designer WebDNA Programmer Database Designer ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Same DB Same Time ( Justin Carroll 2004)
  2. Re: Same DB Same Time ( "Matthew C. Bohne" 2004)
  3. Re: Same DB Same Time ( Gary Krockover 2004)
  4. Re: Same DB Same Time ( Dylan Wood 2004)
  5. Re: Same DB Same Time ( Alex McCombie 2004)
  6. Re: Same DB Same Time ( John Peacock 2004)
  7. Re: Same DB Same Time ( John Peacock 2004)
  8. Re: Same DB Same Time ( "Dan Strong" 2004)
  9. Re: Same DB Same Time ( Alex McCombie 2004)
  10. Re: Same DB Same Time ( Justin Carroll 2004)
  11. Re: Same DB Same Time ( Grant Hulbert 2004)
  12. Re: Same DB Same Time ( John Peacock 2004)
  13. Re: Same DB Same Time ( Alex McCombie 2004)
  14. Same DB Same Time ( Justin Carroll 2004)
On 2/9/04 11:57 AM, "Justin Carroll" wrote: The reason it works when its on one page is that webdna working from top to bottom accesses the functions in a specific order. However, by spreading the process over multiple tpl documents, you throw that order to the wind. The second frame may or may not get in between the append thus causing your number to be out of whack. To webcatalog, these pages are no different than 2 different people on two separate pages trying to do similar things at once (or nearly so). This points to flaws in the logic of how you handle your numbering scheme. I would recommend that you adopt a seed based numbering system based on time and a random extension. Even with time you will get 2 processes hitting in the same second and you can have trouble. Now usually this is very rare, but when you are putting these all on one page yet through multiple frames you increase your likelihood of same second attempts. The problems is not that WebDNA isnt 'buffering' things correctly, but rather the timing of your events is not constant based on multiple frames hitting in different sequences. To get around that you really need to figure out where the logic problem lies (perhaps just the numbering) and either adopt a new logic to overcome this, or stop hitting the system in the fashion you are. Sorry, no slams here, but it seems that the logic change is the only sure fire way to get around the issue these timings are causing for you. HTH Alex > I have two iFrames on a page. Both of the iFrame's src is the same. It is a > .tpl page that does a [replacefounditems] on one database and an [append] on > another database. > > The [replacefounditems] pulls an integer from the database, increases it by > one, and then replaces the old value. The [append] creates a new sku by > grabbing the highest integer and increasing it by one (basically an > autonumber). > > Sometimes this all works just fine with the same .tpl firing at the same time, > accessing the same db at the same time and updating at the same time; however, > sometimes it does not. In the case that it does not, I get duplicate skus and > the integer that is supposed to be updated by the [replacefounditems] does not > update. > > I've tested this numerous times (a lot). It acts like the two statements fire > and collide with each other. Or that one isn't commiting in time for the > other statement to realize anything has changed in the database. It seems like > WebDNA should have some sort of buffer for accessing the same database at the > same time. > > I've wrote the Talk List about this problem before and haven't come up with > any great solution. I'd like to give this another whirl and see if we can't > find something. Please help. Thanks. > > Justin Carroll > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ Alex J McCombie New World Media Chief Information Officer Box 124 888/892.6379 MartVille, NY 13111 Alex@NewWorldMedia.com http://OurClients.com Interface Designer WebDNA Programmer Database Designer ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Alex McCombie

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:

[OT] OSX 3D-Secure support (2006) Problems getting parameters passed into email. (1997) Fun with dates (1997) Tracking (2004) apostrophe in search item (1997) writing db to disk (1997) database performance/design question (2000) Encrypting the seed (2001) Clear command and ShoppingCart.tmpl (1997) File not found error message (1998) OT: Unix Geek Needed (2005) Using [showif] (2000) restart needed???? (1997) Updating a database once per day - An example (1998) [WriteFile] problems (1997) Fax Broadcast (1998) WebTEN vs webSTAR (1998) Undeliverable Mail (1997) Max Record length (1997) NetSplat and WebCat2 (1997)