Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop
This WebDNA talk-list message is from 2010
It keeps the original formatting.
numero = 105621
interpreted = N
texte = Here's the code in my trigger template which is requested once per second. Instead of trying to create 45 new records in a couple of seconds I have resorted to creating only 1-4 new records per second (although I want to create many more for a truly realistic auction simulation).The tickets.db holds all the bidderID (sku) values. I need to search this db and retrieve a series of random bidderID's for the replace contexts:***************************************************************[hideif [getchars start=4&end=5][time][/getchars]\2][showif [getchars start=7&end=8][time][/getchars]\11][search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=[math]ceil((1+[random])/25)[/math]][founditems][replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=[time]&bidderID=[sku][/replace][/founditems][/search][/showif][/hideif][showif [getchars start=4&end=5][time][/getchars]\6][showif [getchars start=7&end=8][time][/getchars]\17][search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=[math]ceil((1+[random])/25)[/math]][founditems][replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=[time]&bidderID=[sku][/replace][/founditems][/search][/showif][/showif]***************************************************************Naturally I cannot use this technique with replacefounditems because I'm searching in a different db than where the records need to be replaced. But there may be another way to approach this problem. I think this might work faster:1- Search the tickets.db for (example) 45 random sku values2. Stores these skus in an indexed table3- Search the bids.db for the next 45 records with blank bidderID values4- Use replacefounditems to change these bidderID's based on lookups of the index values in the tableI don't know if this will be faster or not, but it's probably worth a try as soon as I have some free time again.Sincerely,Kenneth Grome
Associated Messages, from the most recent to the oldest:
Here's the code in my trigger template which is requested once per second. Instead of trying to create 45 new records in a couple of seconds I have resorted to creating only 1-4 new records per second (although I want to create many more for a truly realistic auction simulation).The tickets.db holds all the bidderID (sku) values. I need to search this db and retrieve a series of random bidderID's for the replace contexts:***************************************************************[hideif [getchars start=4&end=5]
[time][/getchars]\2][showif [getchars start=7&end=8]
[time][/getchars]\11][search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=
[math]ceil((1+
[random])/25)[/math]]
[founditems][replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=
[time]&bidderID=[sku][/replace][/founditems][/search][/showif][/hideif][showif [getchars start=4&end=5]
[time][/getchars]\6][showif [getchars start=7&end=8]
[time][/getchars]\17][search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=
[math]ceil((1+
[random])/25)[/math]]
[founditems][replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=
[time]&bidderID=[sku][/replace][/founditems][/search][/showif][/showif]***************************************************************Naturally I cannot use this technique with replacefounditems because I'm searching in a different db than where the records need to be replaced. But there may be another way to approach this problem. I think this might work faster:1- Search the tickets.db for (example) 45 random sku values2. Stores these skus in an indexed table3- Search the bids.db for the next 45 records with blank bidderID values4- Use replacefounditems to change these bidderID's based on lookups of the index values in the tableI don't know if this will be faster or not, but it's probably worth a try as soon as I have some free time again.Sincerely,Kenneth Grome
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)
Mac 2.1b4 unknown error: BadSuffix (1997)
webcat-sys (1998)
re:check boxes (1997)
[WebDNA] How to get the domain name? (2009)
RE: Credit card processing - UK (1997)
know it all (1998)
Great product and great job ! (1997)
Hiding words (2000)
Very serious bug with the [protect] tag (2003)
WebCat2.0 acgi vs plugin (1997)
Buying sans cart (1997)
Finding max value for a field (1997)
Request for improvement... (2002)
Date Question (2002)
Problems passing [SKU] with $Replace in 2.0 (1997)
WebDelivery downloads alias, not original ? (1997)
[WebDNA] anyway to speed up tcpconnect? (2008)
Country & Ship-to address & other fields ? (1997)
Math Context (2001)