jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Leau <costin.l...@gmail.com>
Subject Re[2]: transaction implementation
Date Mon, 19 Sep 2005 09:47:27 GMT
Hello Marcin,

First of all thanks for the reply; I was getting concern :)

> Costin Leau napisal(a):
>> Hello,
>> I'm working on creating on spring support for jackrabbit and jsr-170
>> in general and right now there are two variants of a local transaction
>> manager:
>> 1. one that uses XAResource and assigns dummy Xid's internally in
>> order to create a Transaction object with commit/rollback.

> Why don't you use JOTM and enlist XAResource in it?
There are two TMs - one local and one global. The difference between
them is that the localTM is a lightweight approach which you
can/should use when you don't want your transaction to be part of the
JTA. It's basically just an option which you can use.

The second TM enlists the transaction wiht the JTA transaction
manager(like JOTM). At first I tried to use JOTM from the beginning
but it's a singleton - one instance per VM so basically if you want
your repozitory to use local transactions inside an app server or
along JOTM you can't.

>> 2. one that creates a proxy object around the session and cancels the
>> refresh/save methods (which act as rollback/commit). The advantage is
>> that this approach can work even on repositories which don't have
>> transaction support integrated.
>> I'd like to know if the second approach is a valid one; does this
>> approach covers all the cases inside a session? 

> When you have vesionable node, you must check it out to change it, when
> change does not succseed use of refresh makes no sense - you will throw
> away all modifications, but you will have to check in the node either
> way and make a new version of it (refresh does not "rollback" from 
> checked out to checked in state). So in case of versionable nodes you
> have to use JTA (and checkout node inside transaction) and not to change
> the way refresh works - the refresh method may be used to change the
> node in other way eg. by setting other properties because former ones
> failed.

Got it. Basically I have to use XASession.

Best regards,
 Costin                            mailto:costin.leau@gmail.com

View raw message