0 Replies Latest reply on Sep 23, 2002 3:20 PM by Pete Clearwater

    EJB transactions / Managed Connections problem

    Pete Clearwater Newbie

      Hi.

      I'm porting a large J2EE application from weblogic to JBoss and have run into a problem which I'm not sure if it's a bug or not. We use mostly stateless session beans which have various levels of transaction support.

      Our general pattern is to get a DB connection from a managed pool at the beginning of an EJB method, then close it in a finally clause. This causes problems if I have one bean which has a transaction attribute of NotSupported which has a call to another bean with a transaction attribute of Required. I get the following Exception when I try to call the bean method:

      11:19:43,023 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
      java.lang.IllegalArgumentException: disconnect(ManagedConnection mc: null, Object c: org.jboss.resource.adapter.jdbc.loc
      al.LocalConnection@5c80a4) called with unknown managed connection
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.unregisterAssociation(BaseConnectionManager2.java
      :661)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.disconnect(BaseConnectionManager2.java:619)
      at org.jboss.resource.connectionmanager.CachedConnectionManager.disconnect(CachedConnectionManager.java:358)
      at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:
      149)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:190)

      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)

      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:219)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:705)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy57.updateAddress(Unknown Source)


      If I close the original connection before making the second EJB call, everything works fine. This all worked in Weblogic as well. I'm using JBOSS-3.0.0

      thanks.

      pete.