Both locking schemes will have one node fail in the described scenario.  The 
differences are, using the original poster's example, with PL the commit on 
JVM2 will fail while with OL the commit on JVM1 will fail.

Other differences are that with OL, the fail on JVM1 is local, i.e., it will 
fail before any remote calls are made and hence more efficient.  also with OL 
if the tx on JVM1 hangs, other txs on other JVMs (or even the same JVM) can 
proceed.

If you want proper atomicity, then you get into the realm of distributed locks 
(or fail-fast cooperative locks) but either way, we're talking about extremely 
non-scalable solutions, especially since in a cache, you're looking at a 
mostly-read use-case which should make such a failure rare and a retry 
acceptable.

If you are looking at using the cache to store a heavily updated value, like a 
counter, for example, then a cache is almost certainly the wrong tool for the 
job.  

That said, enough folk have asked for distributed locking and it is on the 
roadmap (albeit low prio - JBCACHE-1098) .  It will almost certainly not be 
enabled by default for scalability reasons though.




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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117966
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to