I have 2 transactions running concurrently. Both the transaction are working on same `user` table. There is a primary key on column `id`, which is AUTO_INCREMENT.
The first transaction updates the latest row(last inserted record) from table `user` using primary key on column `id`. While the second transaction inserts the new record in the `user` table.
Now, I am getting lock wait timeout exception for second transaction. The reason is the first transaction hold the index record lock which prevents second transaction from inserting.
The above case is not happeing if I am updating some other record instead of the last inserted record.
Can someone please let me know why this is happening.
Also please share more details of INDEX RECORD LOCK.
The first transaction updates the latest row(last inserted record) from table `user` using primary key on column `id`. While the second transaction inserts the new record in the `user` table.
Now, I am getting lock wait timeout exception for second transaction. The reason is the first transaction hold the index record lock which prevents second transaction from inserting.
The above case is not happeing if I am updating some other record instead of the last inserted record.
Can someone please let me know why this is happening.
Also please share more details of INDEX RECORD LOCK.