> > I am trying to figure out how to deal with updating the inventory in a > shopping cart. I create (only if it doesn't already exist) an application > scoped array within a CFLOCK populated by looping over a query. As users add > items, I update the quantities in the that array. What I can't figure out is > how to deal with abandoned shopping carts - how do I update the inventory > back to the real value? >
Stas, Personally I would use session or client variables for the cart rather than the application scope. Using the application scope, if you have a cart variable/structure called say "cart" everyone on the site would use the same cart. If you use session or client variables, then each user has their own cart and you don't have the problem of dealing with multiple users using one cart. On a busy site you could quite easily and quickly wind up with timeout/deadlock issues using the application scope. With regards updating the inventory, again personally I would only take items off of the inventory when the user hits the last button on the check out and their order is confirmed at that point. As Robert has just suggested.... hope that helps... Stephen ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

