Hi all,

This mail to get your feedback on really strange things I saw in ODE JBI
Component, ODE runtime and Geronimo dependencies.
(I worked on the 1.2 sources, think that it is the same on the trunk)

1. I have modified the class org.apache.ode.il.dbutil.Database like this in
order to use the embedded mode (just assuming that it should work directly
without any additional configuration) :

private void initInternalDb(String url, String driverClass, String
username,String password) throws DatabaseConfigException {
        __log.debug("Creating connection pool for " + url + " with driver "
+ driverClass);
        if (!(_txm instanceof RecoverableTransactionManager)) {
//              throw new RuntimeException("TransactionManager is not
recoverable.");
                 _txm = new RecoverableTransactionManagerWrapper(_txm);
        }
...
}

and added inner class

   public static class RecoverableTransactionManagerWrapper implements
RecoverableTransactionManager {
        private final TransactionManager txMgr;

        public RecoverableTransactionManagerWrapper(TransactionManager
txMgr) {
            this.txMgr = txMgr;
        }

        public void begin() throws NotSupportedException, SystemException {
            txMgr.begin();
        }

        public void commit() throws HeuristicMixedException,
HeuristicRollbackException, IllegalStateException,
                                    RollbackException, SecurityException,
SystemException {
            txMgr.commit();
        }

        public int getStatus() throws SystemException {
            return txMgr.getStatus();
        }

        public Transaction getTransaction() throws SystemException {
            return txMgr.getTransaction();
        }

        public void resume(Transaction transaction) throws
IllegalStateException, InvalidTransactionException, SystemException {
            txMgr.resume(transaction);
        }

        public void rollback() throws IllegalStateException,
SecurityException, SystemException {
            txMgr.rollback();
        }

        public void setRollbackOnly() throws IllegalStateException,
SystemException {
            txMgr.setRollbackOnly();
        }

        public void setTransactionTimeout(int i) throws SystemException {
            txMgr.setTransactionTimeout(i);
        }

        public Transaction suspend() throws SystemException {
            return txMgr.suspend();
        }

        public void recoveryError(Exception e) {
            throw new UnsupportedOperationException();
        }

        public void recoverResourceManager(NamedXAResource namedXAResource)
{
            throw new UnsupportedOperationException();
        }
    }

This is because the transaction you assume that the transaction manager is
the geronimo one. This is not a standard way to do this.

2. Running buildr, I am not able to get generated files in the bpel-schemas
output jars, so get a CNFE... Since I have never used buildr before, I took
the one for the release --> Works

3. Since I try to deploy the component on PEtALS ESB, I got this nice
exception :
Caused by: java.lang.ClassCastException: org.objectweb.jotm.TransactionImpl
        at
org.apache.geronimo.connector.ConnectorTransactionContext.get(ConnectorTransactionContext.java:49)
        at
org.apache.geronimo.connector.ConnectorTransactionContext.get(ConnectorTransactionContext.java:67)
        at
org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:73)
        at
org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
        at
org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
        at
org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
        at
org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87)
        at 
org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56)
        at
org.apache.ode.scheduler.simple.JdbcDelegate.getConnection(JdbcDelegate.java:254)
        at
org.apache.ode.scheduler.simple.JdbcDelegate.getNodeIds(JdbcDelegate.java:105)
        at
org.apache.ode.scheduler.simple.SimpleScheduler$3.call(SimpleScheduler.java:283)
        at
org.apache.ode.scheduler.simple.SimpleScheduler$3.call(SimpleScheduler.java:282)
        at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:174)
        at
org.apache.ode.scheduler.simple.SimpleScheduler.start(SimpleScheduler.java:280)

It is not a PEtALS problem. Every JBI implementation is free to use the
transaction manager they want. So it is quite boring to see this code in
Geronimo (from class
org.apache.geronimo.connector.ConnectorTransactionContext) :
           try {
                int status = transaction.getStatus();
                if (status != Status.STATUS_COMMITTED && status !=
Status.STATUS_ROLLEDBACK && status != Status.STATUS_UNKNOWN) {
                   
((TransactionImpl)transaction).registerInterposedSynchronization(new
ConnectorSynchronization(ctx, transaction));

This is very bad... Especially when the cast is not required...

What are the plans for ODE right now? What about using recent Geronimo
libraries?
Thanks a lot

Christophe




-----
Christophe Hamerling
PEtALS ESB Project Leader
http://petals.ow2.org http://petals.ow2.org 
SkypeMe on christophe.hamerling
-- 
View this message in context: 
http://www.nabble.com/Deploying-JBI-Component-on-other-container-than-ServiceMix...-tp20325519p20325519.html
Sent from the Apache Ode Dev mailing list archive at Nabble.com.

Reply via email to