If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Instantly selecting then updating fields before other queries can query them

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-09, 10:08
martingavin21 martingavin21 is offline
Registered User
 
Join Date: Oct 2008
Posts: 12
Instantly selecting then updating fields before other queries can query them

Hi,

I've just come up against a new problem (for me) and after some reading around on the net I'm still a little unsure what the correct solution is.

My problem is I have 1000 products going live for sale at a specific time of the day and there could be anything from 2000 to 3000 people on my site waiting for that split second they go live to purchase them.

What I need to do is when customer 1 searches for availability on 7 products it needs to first of all check if there are 7 products with a status of available, if it finds them then it needs to update their status to pending and time stamp them as they will have 4 minutes to purchase before the products are released for other user to buy them.

Doing the select and update queries is not a problem, the problem for me is that when there are so many users all trying to purchase at the same time that once customer 1 finds available products they are instantly updated to pending before anyone else can find them as available.

Does the "start transaction" function take care of this?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On