jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malzer Ferdinand OSP sIT <Ferdinand.Mal...@s-itsolutions.at>
Subject using javax.transaction.UserTransaction with JackRabbit 2.4.3
Date Mon, 11 Mar 2013 14:33:58 GMT
Hello,
In JackRabbit the query of Repository.OPTION_TRANSACTIONS_SUPPORTED return true.
Therefore we want to use javax.transaction.UserTransaction with JackRabbit.

What we want to do is shown in the following simplified pseude-code:


        Session session = null;
        Transaction tx = null;
        try {
            session = login(...);

            tx = new Transaction();
            tx.begin();

            //delete resources persisted in another TX datasource
            cleanOtherDBResources();

            //delete a node persisted in JackRabbit
            Node node = session.getNode(path);
            node.remove();
            session.save();

            tx.commit();

        } catch (Exception e) {
            if (tx != null) { tx.softRollback();}
        } finally {
            if (session != null) { session.logout();}
        }


when we use a  non XA-datasource for the JackRabbit PersistenceManager we get the following
exception:

Caused by: java.sql.SQLException: Connection has already been created in this tx context for
pool named cmspool. Illegal attempt to create connection from another pool: jackrabbitpool
        at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:608)
        at weblogic.jdbc.jts.Driver.connect(Driver.java:127)
        at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:339)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper.getConnection(ConnectionHelper.java:436)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper.startBatch(ConnectionHelper.java:239)
        at org.apache.jackrabbit.core.journal.DatabaseJournal.startBatch(DatabaseJournal.java:506)
        at org.apache.jackrabbit.core.journal.DatabaseJournal.doLock(DatabaseJournal.java:474)


when we use a XA-datasource for the JackRabbit PersistenceManager we get the following exception:

Caused by: java.sql.SQLException: Cannot set auto commit to "true" when in distributed transaction.
        at weblogic.jdbc.wrapper.JTSConnection.setAutoCommit(JTSConnection.java:593)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper.getConnection(ConnectionHelper.java:439)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper.startBatch(ConnectionHelper.java:239)
        at org.apache.jackrabbit.core.journal.DatabaseJournal.startBatch(DatabaseJournal.java:506)
        at org.apache.jackrabbit.core.journal.DatabaseJournal.doLock(DatabaseJournal.java:474)

Does somebody know how to use javax.transaction.UserTransaction in JackRabbit and how the
datasource has to be configured?
Thx in advance!

ferry malzer

Mime
View raw message