MySQL Forums
Forum List  »  InnoDB

Need more detail about index-record lock
Posted by: shridhar mali
Date: February 14, 2018 01:32AM

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.

Options: ReplyQuote

Written By
Need more detail about index-record lock
February 14, 2018 01:32AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.