2

No matter how much I try, I do not understand compatibility matrix of intent locking. Why were SIX and IX denied if x lock has been held? Suppose x lock holds for record r1 then taking IX just means that some record in the table held X lock? If so, I think it should not be denied. Why is IX denied if S lock has been held? Why is IX allowed if IS has been held? Why IS is allowed if IX has been held?

  • Which DBMS are you using? – a_horse_with_no_name Feb 19 '17 at 11:09
  • I assume you are talking about the matrix in the innodb locking documentation? Although you can read into it that e.g. "X" means the row lock from the previous topic while "IX" is table lock, it actually never says it. This matrix only compares table locks with table locks (and also row locks with row locks), but not an "X" row lock with an IX table lock. It simply shows: you cannot get e.g. an IX table lock if another transaction already holds an X or S lock on the table (!). And IS is allowed if IX is there because it's just a technical trick: you actually don't want to do a full table lock. – Solarflare Feb 20 '17 at 1:48
  • It is very clear now. Thank you very much. :-) – Ju Ju Feb 23 '17 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.