MySQL atomic operations and table locking
问题 I have a website where users can purchase tickets, but ticket quantities are usually limited and go quickly. I'm trying to implement an escrow system such that a user can click that they want x number of tickets, at which point I will put them in an escrow state. That gives them several minutes to enter their credit card information and complete the purchase. I have three relevant tables: events, tickets, and escrow. A row in the events table describes the event itself, including the maximum