[jboss-user] [JBossCache] - Exclusive lock on bottom (leaf) node only?

atijms do-not-reply at jboss.com
Tue May 29 13:16:20 EDT 2007


I'm in a situation where I would like to have an exclusive lock on only the leaf node in a tree. 

E.g. suppose I have a tree with entries "/a/b/n1" and "/a/b/n2". When Tx1 accesses "/a/b/n1", Tx2 should not be able to also access (either read or write) "/a/b/n1" until Tx1 has completed and released its locks. However, meanwhile Tx3 should be able to access "/a/b/n2".

With isolation level SERIALIZABLE, the entire tree is exclusively locked. E.g. when Tx1 in the above example accesses "/a/b/n1" and writes to n1, it has a read lock on a and b and a write lock on n1. If meanwhile Tx3 wants to access "/a/b/n2", it already fails to acquire the read lock on "/a", making it impossible to reach "/a/b" and "a/b/n2"

The lower isolation levels also don't work for my usecase. E.g. when Tx1 accesses "/a/b/n1" and reads n1, Tx2 is also able to read n1 at the same time, which is what should not be allowed.

In short, I would like to be able to have SERIALIZABLE semantics per specific sub-tree instead of the whole tree.

Is something like that possible with JbossCache?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049461#4049461

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049461

More information about the jboss-user mailing list