Deadlock found when trying to get a lock

Asked By 10 points N/A Posted on -
qa-featured

Hi,

I am getting the following error message when I try to do a batch insert of about 700 floats. I just get this annoying problem when try to restart the transaction. How can I fix this issue? Have any idea to resolve the following matter? I would be grateful to you. Thanks in advance.

RightNow CX-fout

RightNow CX-fout

Deadlock found when trying to get lock; try restarting transaction

SHARE
Answered By 0 points N/A #175858

Deadlock found when trying to get a lock

qa-featured

Hi,

This situation occurs when two transaction hold on each other to again lock. So, concurrent transactions never try to update a row which creates deadlock.

T1: lock x, then y

T 2: lock y, then x

To avoid the deadlock, change the queries such that transactions would lock at same order.

T 1: locks key x, locks key y;

T 2: locks key x, locks key y;

There can also be problem of missing indexes. Always make sure to have indexes on foreign or primary keys. If not done this way, this could result in table lock instead of row lock.

Related Questions