> During the checkout process, I do a named lock, check
> to be sure the quantities for the items haven't changed
> due to a sale or something else, charge the credit card,
> then commit the order to the db.

You could use a temporary locking table in the database while the
transaction is in limbo.  When the user gets sent to the outside payment
service, put a record in a table that shows that the user has a "lock" on
item ID and quantity.  Any other users going through checkout would check
against this table to see if there is a lock and if there is, whether there
would still be enough quantity available for them (inventory - temporary
locks = real quantity to check against).  This check can also clear any
temporary locks that have lived for more than say, half an hour (user likely
abandoned at payment).  If the payment is completed and you get the IPN
post-back you can then process the transaction locally and clear the
temporary lock entry and adjust the quantity.


-Justin



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:313054
Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-community/unsubscribe.cfm

Reply via email to