Lock and Isolation for resource reservation pattern
问题 I need to solve a resource reservation pattern with Spring and MariaDB. The problem is very simple, I have a guest table where I store guest names of events, I have to be sure that the guest count for the event must be less or equals the maximum capacity. This is the table: create table guest( event int, name varchar(50) ) create index event on guest (event); What is the right lock procedure and isolation level for DB? Please consider that this code will run in multi-threading container. I