Can a database get stomped by simultaneous access?
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13033
interpreted = N
texte = 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=CART¬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&returnField=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----------------------------------------------------------------------| William Curt Eggemeyer Curt@mail.bzzzzzz.com || BeeHive Technologies, Inc. || http://www.bzzzzzz.com with a WebCam in Pasadena, California |----------------------------------------------------------------------
Associated Messages, from the most recent to the oldest:
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=CART¬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&returnField=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----------------------------------------------------------------------| William Curt Eggemeyer Curt@mail.bzzzzzz.com || BeeHive Technologies, Inc. || http://www.bzzzzzz.com with a WebCam in Pasadena, California |----------------------------------------------------------------------
w curt eggemeyer
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:
[WebDNA] EMailFolder/ (2016)
Product display (2000)
ImageMagick (2005)
Cache Access Error (2000)
Emailer (1997)
all records returned. (1997)
WebCatalog2 Feature Feedback (1996)
Calendar (1997)
writefile - continued (1997)
Speaking of... (1999)
Re:need help please (1997)
redirect with more than 256 characters (1999)
webcat and OS 8 (1997)
[math] show=F exists? (1997)
SKU lookup (1997)
Sitebuilder (2004)
Still having problems with Authen (1997)
calculating tax rates, mail order solutions and version 2 (1997)
WC2.0 Memory Requirements (1997)
WebTen Memory Error with Plug-In (1998)