RE: Can a database get stomped by simultaneous access?
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13039
interpreted = N
texte = Curt -Yes, WebCatalog should always perform the database operations for that template completely before doing them again for another request, even if they come in at the same time; it's smart enough to prevent your databases from getting munged up for simultaneous requests.Are you seeing two entries for the same cart number despite the [HideIf] context?thanks,Marc EagleStarNine Technologieshttp://www.smithmicro.com/>We use a database to maintain an incremental counter we use as an invoice>order number with our webcat online orders, but we have had problems in>which every so often (we suspect it could be when we need to restart) we >get duplicate numbers for the counter in that database. The>ourDBs/Invoice_Counter_No.db contains just two fields [CART] and>[InvoiceNo] it started with a 0 value for a cart (which gets replaced by >the cart generated by webcat) and the desired invoice number we wish to>start from when we brought our online system up.>>Below is a sample code snippet of what we do:>>[CLOSEDATABASE ourDBs/Invoice_Counter_No.db]>[HideIf [lookup>db=OurDBs/Invoice_Counter_No.db&Value=[CART]&lookInField=CART&returnField=C>ART¬Found=0]=[CART]]>[Replace db=OurDBs/Inv_Receipt_No.db&eqCARTdata=0]CART=[CART][/Replace]>[Append db=OurDBs/Invoice_Counter_No.db]CART=0&InvoiceNo=[math][lookup>db=OurDBs/Invoice_Counter_No.db&Value=[CART]&lookInField=CART&returnFiel>d=InvoiceNo]+1[/math][/append][/Hideif]>>>The question is if we add a [closedatabase ourDBs/Invoice_Counter_No.db] >form after this operation could two customers simultaneously trying to>place an order stomp this database? Is webcat smart enough to keep a>database open if an operation is occurring on it even though another>customer may have hit the closedatabase form from another order?>>Curt
Associated Messages, from the most recent to the oldest:
Curt -Yes, WebCatalog should always perform the database operations for that template completely before doing them again for another request, even if they come in at the same time; it's smart enough to prevent your databases from getting munged up for simultaneous requests.Are you seeing two entries for the same cart number despite the
[hideif] context?thanks,Marc EagleStarNine Technologieshttp://www.smithmicro.com/>We use a database to maintain an incremental counter we use as an invoice>order number with our webcat online orders, but we have had problems in>which every so often (we suspect it could be when we need to restart) we >get duplicate numbers for the counter in that database. The>ourDBs/Invoice_Counter_No.db contains just two fields
[cart] and>[InvoiceNo] it started with a 0 value for a cart (which gets replaced by >the cart generated by webcat) and the desired invoice number we wish to>start from when we brought our online system up.>>Below is a sample code snippet of what we do:>>[CLOSEDATABASE ourDBs/Invoice_Counter_No.db]>[HideIf [lookup>db=OurDBs/Invoice_Counter_No.db&Value=
[cart]&lookInField=CART&returnField=C>ART¬Found=0]=
[cart]]>[Replace db=OurDBs/Inv_Receipt_No.db&eqCARTdata=0]CART=
[cart][/Replace]>[Append db=OurDBs/Invoice_Counter_No.db]CART=0&InvoiceNo=
[math][lookup>db=OurDBs/Invoice_Counter_No.db&Value=
[cart]&lookInField=CART&returnFiel>d=InvoiceNo]+1[/math][/append][/Hideif]>>>The question is if we add a [closedatabase ourDBs/Invoice_Counter_No.db] >form after this operation could two customers simultaneously trying to>place an order stomp this database? Is webcat smart enough to keep a>database open if an operation is occurring on it even though another>customer may have hit the closedatabase form from another order?>>Curt
Marc Eagle
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:
$Quit, $CloseDatabase corrections (1997)
[WebDNA] Build Name for 6.1 (2008)
WebCat for Site Search? (1997)
Appending Information from one db to another (1998)
OS Limitations (1998)
WebCat2b12 - nesting [tags] (1997)
Multiple Ad databases? (1997)
[WebDNA] How much does it cost now? (2008)
FlushDatabase Suggestion (1998)
Emailer Chokes on bad address (1997)
Removing [showif] makes a big difference in speed (1997)
frames & carts (1997)
authenticating a second user (1997)
cart converting to scientific notation format (2001)
Summing fields (1997)
WebCat2: Items xx to xx shown, etc. (1997)
Return records from another (1997)
[WebDNA] inputed text getting scrambled up in DB (2012)
World Address Info (2003)
OT: PDF (2004)