Skip navigation links

MySQL Forums :: Transactions :: mysql innodb transaction concurrency


Advanced Search

Re: mysql innodb transaction concurrency
Posted by: Rick James ()
Date: August 14, 2011 11:59AM

Do NOT use InnoDB's locking to handle long-running transactions.
8 minutes is LONG!
8 seconds is maybe OK.

Keep your reservation system!

An item has 3 states:
* In inventory, available for someone to purchase;
* Grabbed by someone, but awaiting confirmed purchase; others are not allowed to initiate a purchase on this item; (You could provide the info "this items is 'tentatively' sold.)
* Purchased.

Alternatively, you could design it so an item goes through these 2-3 steps:
* In inventory, available for someone to purchase;
* Purchased;
* If they fail to purchase (or 8 minutes passes), then "put it back into inventory"

Either scheme would use InnoDB transactions _within_ each of the three steps. This would assure consistency at the low level. You have to assure consistency at the high level (via the three steps).

Furthermore (assuming this is web-based)...
A web page is "stateless". You cannot carry a MySQL connection from one page to the next. So, you cannot keep an InnoDB transaction open.

Furthermore...
Do you really want to lock out other users for 8 minutes? 1 second is long enough!

Options: ReplyQuote


Subject Views Written By Posted
mysql innodb transaction concurrency 3425 venu gopal 08/02/2011 09:08AM
Re: mysql innodb transaction concurrency 732 venu gopal 08/02/2011 09:39AM
Re: mysql innodb transaction concurrency 689 venu gopal 08/03/2011 09:56AM
Re: mysql innodb transaction concurrency 765 Peter Brawley 08/03/2011 10:05AM
Re: mysql innodb transaction concurrency 791 venu gopal 08/03/2011 10:13AM
Re: mysql innodb transaction concurrency 692 venu gopal 08/04/2011 10:24AM
Re: mysql innodb transaction concurrency 670 Peter Brawley 08/04/2011 11:40AM
Re: mysql innodb transaction concurrency 746 venu gopal 08/04/2011 11:36PM
Re: mysql innodb transaction concurrency 663 venu gopal 08/06/2011 07:33AM
Re: mysql innodb transaction concurrency 678 Peter Brawley 08/06/2011 12:57PM
Re: mysql innodb transaction concurrency 791 venu gopal 08/09/2011 08:04AM
Re: mysql innodb transaction concurrency 706 Peter Brawley 08/10/2011 08:44PM
Re: mysql innodb transaction concurrency 637 venu gopal 08/11/2011 12:28AM
Re: mysql innodb transaction concurrency 1100 Rick James 08/13/2011 01:45PM
Re: mysql innodb transaction concurrency 1059 venu gopal 08/14/2011 04:47AM
Re: mysql innodb transaction concurrency 872 Peter Brawley 08/14/2011 08:50AM
Re: mysql innodb transaction concurrency 652 venu gopal 08/14/2011 08:57AM
Re: mysql innodb transaction concurrency 948 Rick James 08/14/2011 11:59AM
Re: mysql innodb transaction concurrency 871 venu gopal 08/14/2011 11:46PM
Re: mysql innodb transaction concurrency 624 venu gopal 08/19/2011 11:03AM
Re: mysql innodb transaction concurrency 644 Rick James 08/20/2011 08:52AM
Re: mysql innodb transaction concurrency 596 venu gopal 08/20/2011 09:00AM
Re: mysql innodb transaction concurrency 699 Rick James 08/21/2011 08:38AM
Re: mysql innodb transaction concurrency 632 venu gopal 08/22/2011 12:29AM
Re: mysql innodb transaction concurrency 677 Rick James 08/22/2011 07:38PM
Re: mysql innodb transaction concurrency 635 Peter Brawley 08/14/2011 01:39PM
Re: mysql innodb transaction concurrency 794 venu gopal 08/15/2011 12:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.