You can use the Serializable isolation level in your transactions. Ex) Two threads, T1 and T2, are trying to book the same table at the same time. T2 is blocked as soon as it tries to perform any operation (whether read or write) that conflicts with T1’s ongoing transaction.