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