jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "(Berry) A.W. van Halderen" <b.vanhalde...@hippo.nl>
Subject Re: Transactions in jackrabbit using RMI?
Date Wed, 30 May 2007 11:36:27 GMT
On Wed, May 30, 2007 at 01:17:29PM +0300, Jukka Zitting wrote:
> On 5/30/07, gsoap <gsoap123@yahoo.com> wrote:
> >I am connecting to a repository through RMI.
> >
> >I want to perform operations on repository in the form of transactions.
> Unfortunately no. The RMI layer currently doesn't support transactions.
> Please file a feature request in Jira for that. Any contributions to
> implement transactions using RMI would also be welcome. :-)

For an evaluation of JackRabbit we needed to create a test and setup
where JCR operations where performed over RMI while having a transactional
session.  Unless I've overlooked some issue I had implemented just this
quite easily.

I think the only thing that needed to be implemented is to extend both
client and server side decorator stubs to implement the XAResource
interface.  The client, when asked for the getXAResource() can just return
itself.  In the implementation of the XAResource interface the client stub
can just call the server side stub over RMI.  The server side stub just
forwards the call to the actual session.
This works because the transaction IDs (Xid) are serializable, and can
be passed over RMI.  The transactions themselves are managed at the
client side.

This seems to work fine (commit, rollback, etcetera).  Am I missing something,
otherwise I'll extract the code for this and post it on the Jira issue.

Berry A.W. van Halderen           b.vanhalderen@hippo.nl / berry@halderen.net
Disclaimer: the above is the author's personal opinion and is not the opinion
or policy of his employer or of the little green men that have been following
him all day.

View raw message