From: SourceForge.net <no...@so...> - 2010-06-08 10:19:04
|
The following forum message was posted by iamyaw at http://sourceforge.net/projects/cubridcluster/forums/forum/1129811/topic/3734606: The answer is why the technology is called \"next key locking\" or \"key range locking\". The main purpose of next key locking is to avoid phantom problem. This technique is suggested by the well-know paper \"ARIES/KVL\" by IBM DB2. (http://www.vldb.org/conf/1990/P392.PDF) You can read also MySQL manual, http://dev.mysql.com/doc/refman/5.0/en/innodb-next-key-locking.html. In CUBRID, next key locking is implemented by locking the next object too. Why 12 also? Let\'s image when one transaction is doing SELECT * FROM t WHERE id>7; and the other concurrent transaction is doing INSERT INTO t(id) VALUES (10). What happens if the first transaction is doing the SELECT again? What happens if the second transaction is rolled back? I believe you can catch up the idea of \"Next key locking\". |