MGL - multi-granularity locking
I have a g开发者_如何学JAVAeneral (maybe stupid) question about MGL locking. For example, we have physical hierarchy db->table->row. I want modify row -> If I use MGL, put IX to DB, IX to table and X to row (as you shown). Can I use ony S and X locks? e.g. S lock on DB, X lock on table? => row cannot be inserted/deleted/updated/read. Or I can do S lock on DB, X lock on table, find row, X lock on row, unlock table, modify row. (I known, MGL come from predicate lock and its explanation is widely known [e.g. Gray: Transaction processing].
Thanks
You can not lock S on DB while lock X on table. They are conflicting lock. Please find the MGL compatibility matrix from this wiki.
精彩评论