MySQL Forums
Forum List  »  InnoDB

Explain this locking behavior to me
Posted by: Preston Price
Date: September 10, 2008 10:08AM

So, I have a job table with a few thousand record in it. I want to have concurrent connections be able to pull out jobs from this table without overlapping jobs in the result set.

So on connection1 I do this:
: start transaction;
: select jobID from jobs limit 100 for update;
and I get my 100 records.

Meanwhile on connection2 I do the same thing:
: start transaction;
: select jobID from jobs limit 100 for update;
and it hangs waiting for the transaction from connection 1 to end.

Show innodb status reports that the transaction from connection1 has 101 row locks, so then why does the transaction on connection2 hang when there are unlocked records it could return?

Thanks in advance!

-Preston

Options: ReplyQuote


Subject
Views
Written By
Posted
Explain this locking behavior to me
2398
September 10, 2008 10:08AM
1540
September 10, 2008 07:14PM


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.