2 Replies Latest reply on Nov 12, 2003 11:00 PM by Adrian Brock

    unnable to commit using session bean and lido

    Ernst Newbie

      Hello,

      I'm trying to use a Stateless Session Bean Wrapper around JDO enhanced classes to manage persistence. I've configured a JCA connector for LIDO and PostgreSQL as expalained in the samples (see attached files). Here are the symptoms.

      1) When a servlet obtains a configured PersistenceManagerFactory through JNDI, starts a transaction, calls the EJB method (which obtains its own PersistenceManagerFactory in the same manner as the servlet), and commits the transaction everything works fine and the updates are reflected in PostgreSQL.

      2) When a client calls the same method without obtaining a configured PersistenceManagerFactory and managing explicitly the transaction, the method fails with JBoss complaining about not having a transaction with the following errors :

      11:08:51,554 WARN [TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.
      11:08:51,876 INFO [DmsSessionBean] closing persistence manager
      11:08:51,877 INFO [DmsSessionBean] closed persistence manager
      11:08:52,167 ERROR [LogInterceptor] TransactionRolledbackException in method: public abstract void ca.umontreal.lexum.dms.interfaces.DmsSessionBeanRemote.createShipment(ca.umontreal.lexum.dms.jdo.Shipment) throws java.rmi.RemoteException, causedBy:
      org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=novara.lan.lexum.pri//23, BranchQual=] status=STATUS_NO_TRANSACTION
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:409)
      at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:398)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:277)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:536)
      11:31:17,328 WARN [JBossManagedConnectionPool] Exception destroying ManagedConnection
      javax.jdo.JDOFatalUserException: The PersistenceManager has been closed while its transaction was active. The transaction has been rollbacked.
      at com.libelis.lido.c.close(c.java:321)
      at com.libelis.lido.jca.JDOManagedConnection.destroy(JDOManagedConnection.java:96)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.doDestroy(InternalManagedConnectionPool.java:476)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.removeTimedOut(InternalManagedConnectionPool.java:362)
      at org.jboss.resource.connectionmanager.IdleRemover$1.run(IdleRemover.java:70)
      at java.lang.Thread.run(Thread.java:536)

      It's as if Jboss never realized that LIDO has started a transaction, and since it is being executed in a server environment, I should have to worry about transaction management in the session bean. I'm not shure if JBoss and/or Lido is to blame for this. Can someone give me a few pointers.

      Thanks,