jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Cenkier <marcin.cenk...@cognifide.com>
Subject Re: transaction implementation
Date Mon, 19 Sep 2005 09:29:51 GMT
Costin Leau napisał(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?

> 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 

Marcin Cenkier

View raw message