jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject JTA support
Date Thu, 21 Oct 2004 17:49:00 GMT
as you might have noticed i have just committed a large chunk
of code. this is the first implementation of transaction support (JTA)
in jackrabbit!

the code has been contributed by dominique pfister and i think
he has done a great job :)

dominique is lurking in the jackrabbit-dev list and i'm sure that
he'll be happy to answer all tx related questions that might come up.

jta support is exposed via the XASession, i.e. Repository.login()
returns a XASession instance instead of the regular Session.

if you want to get your hands dirty and test the tx support,
you can use code like this:


    Credentials creds = new SimpleCredentials("anonymous", "".toCharArray());
    XASession session = (XASession) r.login(creds, null);
    // get XAResource
    XAResource xares = session.getXAResource();

    // create dummy Xid
    Xid xid = new Xid() {
        public byte[] getBranchQualifier() {
            return new byte[0];

        public int getFormatId() {
            return 0;

        public byte[] getGlobalTransactionId() {
            return new byte[0];

    xares.start(xid, XAResource.TMNOFLAGS);

     // .... add new nodes & properties and save them

    xares.end(xid, XAResource.TMSUCCESS);

    xares.commit(xid, false);



View raw message