This content has been marked as final. Show 3 replies
Does JBoss Cache 3.x support SELECT FOR UPDATE semantics?
Not at this moment. It can be emulated, though by using pessimistic locking with transactions. e.g. if you are using the repeatable_read isolation level, and read a node within a TX it will be locked and no other tx would be able to modify the node until this one finishes.
This is not supported on MVCC though, which may be an drawback for you due to performance advantages MVCC brings.
Actually, it is supported. :-)
Just do this:
// start transaction ... cache.getInvocationContext().getOptionOverrides().setForceWriteLock(true); Node n = cache.get("/a/b/c"); // this acquires a WRITE LOCK on this node ... ... // end transaction
In fact, I am going to add this to the 3.x FAQs