Well, that's a problem. Let's assume that we can mark a quantity of an
item as "taken" when they place it in their shopping cart. What percentage
of shopping carts are abandonned? Plenty. So that inventory is locked up
until this cleanup runs - which may be before the user has finished
shopping!

> A suggestion is to when the user selects the 
> room/item is to mark the record as being taken,
> and with a date/time.
> 
> Thus not available for someone else.
> 
> Then I would run a clean up file to unmark those 
> checked after say 20 minutes or so.
> 
> Maybe a scheduled task every hour
> 
> 
> 
> 
> -----Original Message-----
> From: Tony Schreiber [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 09, 2001 7:06 AM
> To: CF-Talk
> Subject: Re: concurrency problem..
> 
> 
> I have somewhat of the same issue... In my shopping cart which show live
> inventory available, stock is check before you put the item in the cart.
> And then again during a transaction which puts the item in your order. But
> there is the possibility that someone will have ordered the last widget
> AFTER the inventory check, but BEFORE the actual decrement of inventory.
> 
> How does everyone handle this?
> 
> > hi ppl... i have a hotel booking system that lets the users to reserve
> room thru the web.
> > I retrieve the hotel room capacity to show the current room available...
> if the capacity is zero.. the page will indicate fully booked.
> >  In order to have the most updated info..
> > i actually retrieve the room capacity again from the database juz before
> updating...
> > but seems still have slight chance to have multiple submission at microsec
> difference...
> > 
> > i thinking of using CFLOCK to contain the read,update queries..
> > however.. at the admin module... i have a function that enable the
> administrator to update the total room capacity...
> > so.. which means i cant use CFLOCK (..from my understanding.. CFLOCK only
> locks requests from same page...)
> > 
> > Any advice??
> > 
> > heard that i can use stored procedure from the DB to "lock" the table...??
> > i never use stored procedure b4... so any kind soul can kindly guide me to
> some examples or website where i can learn??
> > 
> > 
> > thanx in advance...
> > 
> > han
> > 
> > 
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to