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 AW: using javax.transaction.UserTransaction with JackRabbit 2.4.3
Date Mon, 25 Mar 2013 10:13:56 GMT
hello,
thx for your information.

now i have configured the used woblogic-datasource to 'don't support global transactions'
and now it works fine.
:-) ferry malzer 

-----Ursprüngliche Nachricht-----
Von: KÖLL Claus [mailto:C.KOELL@TIROL.GV.AT] 
Gesendet: Montag, 25. März 2013 08:01
An: users@jackrabbit.apache.org
Betreff: AW: using javax.transaction.UserTransaction with JackRabbit 2.4.3 [heur]

Hi Ferdinant,

Jackrabbit itself is the XA Resource so therefore you must not use a datasource witch is managed
by the container.
Can you attach your config file ?

greets
claus

-----Ursprüngliche Nachricht-----
Von: Malzer Ferdinand OSP sIT [mailto:Ferdinand.Malzer@s-itsolutions.at] 
Gesendet: Montag, 11. März 2013 15:34
An: users@jackrabbit.apache.org
Betreff: using javax.transaction.UserTransaction with JackRabbit 2.4.3

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