This content has been marked as final.
Show 3 replies
-
1. Re: SELECT FOR UPDATE semantics
mircea.markus Nov 10, 2008 3:52 AM (in response to yonis)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. -
2. Re: SELECT FOR UPDATE semantics
manik Nov 10, 2008 6:34 AM (in response to yonis)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
-
3. Re: SELECT FOR UPDATE semantics
manik Nov 10, 2008 6:35 AM (in response to yonis)In fact, I am going to add this to the 3.x FAQs