-
1. Re: Node Locking
belaban Oct 30, 2004 7:37 AM (in response to jiwils)Yes, use a TxManager. If you don't run inside the container, use DummyTransactionManager. Check the XML file(s) for an example.
Bela -
2. Re: Node Locking
jiwils Nov 1, 2004 12:02 AM (in response to jiwils)"bela" wrote:
Yes, use a TxManager. If you don't run inside the container, use DummyTransactionManager. Check the XML file(s) for an example.
Great! Thanks for the advice. I have looked at the code/XML examples where the DummyTransactionManager was used, but I assumed it was just a "dummy"/mock obect for testing because of its name. -
3. Re: Node Locking
belaban Nov 1, 2004 2:11 AM (in response to jiwils)It doesn't support TX recovery etc, but I think it handles the before/afterCompletion() 2PC protocol correctly.
Bela -
4. Re: Node Locking
ben.wang Nov 1, 2004 1:42 PM (in response to jiwils)Just add addition comments.
1. You don't need a tm to set the isolation level. With tx, the underlying lock behaving like an "auto-commit" with isolation level.
2. One advantage of using tm is you get batch replication update during prepare/commit phase. So that has performance implication.
3. DummyTransaction manager is only single-threaded now (e.g., support one tx at one time). We may extend it to handle multiple threads in the future.
I will put these into FAQ.
Thanks,
-Ben -
5. Re: Node Locking
jiwils Nov 2, 2004 3:00 PM (in response to jiwils)So, my code looks something like this:
if (cach.containsKey(key)) { throw something; } <acquire lock>/<begin transaction> if (cach.containsKey(key)) { <release lock>/<rollback transaction> throw something; } cache.put(blah, key, value); <release lock>/<commit transaction>
Given these semantics, would I need to use a SERIALIZABLE isolation level, or could I get by with REPEATABLE_READ?