Not the answer you need?
Register and ask your own question!

intention locks - what is a main purpose?

jurajfjurajf EntrantCurrent User Role Participant
Hi there,

I have a (may be) stupid question about intention locks. For example I have hierarchy DB - TABLE - ROW and two transaction T1 and T2.

T1: if I modify ROW I place IX on DB and TABLE and X lock on ROW. T2: if I want to delete table I place X on DB => it must wait for T1 because T1 has IX on DB. Can I simulate similar behavior only using S/X locks? Consider same example:

T1: I place S lock on DB and TABLE and X lock on ROW. T2: I place X lock on DB => it must wait for T1 because T1 has S on DB. => Does it need a intention lock?

Thanks for explanation.

J.

Comments

  • xaprbxaprb Mentor Inactive User Role Leader
  • jurajfjurajf Entrant Current User Role Participant
    I known this MGL wiki (but I don't see need for simple hierarchical locking), but question was another. Using only S/X locks (for example: S(DB) then S(TABLE) then X(ROW)) would work as hierarchical locking. Or Not? Or Intention lock are only lock escalation? thanks

    J.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.