3 Replies Latest reply on May 14, 2007 12:49 AM by tonylmai

    Raising an event in Seam without violating EJB's concurrent

      Hello,

      I am trying to raise an event inside an action which is modeled as a stateful session bean. This resulted in violation for concurrent call in EJB.

      16:40:41,859 ERROR [SeamPhaseListener] uncaught exception
      javax.faces.el.EvaluationException: javax.ejb.ConcurrentAccessException: no concurrent calls on stateful bean 'jboss.j2ee:service=EJB3,name=OrderManagerBean' (EJB3 4.3.13)
      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
      at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
      at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
      at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
      at org.jboss.seam.core.Pages.callAction(Pages.java:499)
      at org.jboss.seam.core.Pages.enterPage(Pages.java:282)
      at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:276)
      ...
      Caused by: javax.ejb.ConcurrentAccessException: no concurrent calls on stateful bean 'jboss.j2ee:service=EJB3,name=OrderManagerBean' (EJB3 4.3.13)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:73)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)


      Is there a way that I could raise an event in Seam without violating this EJB rule?

      Thanks


        • 1. Re: Raising an event in Seam without violating EJB's concurr
          stu2

          Coud you post some more details. I'm using events raised by SFSB just fine. Please post the relevant snippets where your event is raised, the receiver, and where the event handling is configured in components.xml. Also your stacktrace doesn't show any application code, so more of that would be helpful.

          • 2. Re: Raising an event in Seam without violating EJB's concurr

            Are you trying to raise an event and observe it in the same bean?

            • 3. Re: Raising an event in Seam without violating EJB's concurr

              Not exactly in the same bean but perhaps the same thread that the started by the very same SLSB that wanted to listen to the event.

              Here is the details:

              I have an OrderManagerBean (SFSB) that contains orders from the top of a queue (collection) managed by a (application scope) bean which contains all outstanding orders. This application-scope bean serves as my (cache/singleton) to all orders.

              When user invokes the OrderManagerBean.ship(order), this SFSB does the normal business routines then instruct the application bean to remove the specified order from its cache. Since there may be more than one OrderManagerBean instances, I would like to raise an Event to instruct the all OrderManagerBean to refresh its own cache.

              So I guess you could say it's same bean. Is there a problem with this design?