2 Replies Latest reply on Nov 9, 2007 6:43 PM by Konstantin Sobolev

    SessionSynchronization handling bug?

    Konstantin Sobolev Newbie

      Hi

      I wrote a funny SFSB which implements SessionSynchronization and tries to kill itself in afterCompletion:

      .. afterCompletion() {
       sessionContext.getEJBObject().remove();
      }
      


      However, JBoss gets very upset about it:

      Caused by: java.lang.IllegalStateException: Already committed. TransactionImpl:XidImpl[FormatId=257, GlobalId=kos/2590, BranchQual=, localId=2590]
       at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:633)
       at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.register(StatefulSessionInstanceInterceptor.java:182)
      


      Isn't it a spec violation? It says that SessionSynchronization methods must run with an unspecified transaction context.

      Thanks

        • 1. Re: SessionSynchronization handling bug?
          Konstantin Sobolev Newbie

          doesn't work on 4.2.2 as well:

          02:12:06,855 ERROR [TxInterceptorCMT] IllegalStateException while setting transaction for rollback only
          java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] T
          he transaction is not active!
           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.setRollbackOnly(TransactionImple.java:380)
           at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:157)
           at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:378)
           at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
           at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
           at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
           at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
           at org.jboss.ejb.Container.invoke(Container.java:960)
           at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
           at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
           at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
           at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
           at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
           at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
           at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:121)
           at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
           at $Proxy367.remove(Unknown Source)
          


          • 2. Re: SessionSynchronization handling bug?
            Konstantin Sobolev Newbie

            found reply myself. ejb 2.1 spec, 7.6.1 says that afterCompletion cannot access enterprise beans