How do I achieve the situation where the rows read by one transaction are not allowed to be read by another transaction?
From one of my tables with columnA-F, I need to select the max(columnA)
. With the max value and based on some calculation, I will have to perform other insert statements.
With serializable isolation level, 2 transactions are reading the same max value. This is resulting in a lock wait for one transaction and deadlock on the other transaction.