3 Replies Latest reply on Nov 28, 2006 8:33 PM by Andrew Rubinger

    reentrant annotation?

    supert24 supert24 Newbie

      Since my stateful session beans call each other , causing a
      concurrent access exception: does any @reentrant annotation exist to decorate session beans with?

        • 1. Re: reentrant annotation?
          Andrew Rubinger Master

          Shouldn't be. Violation of the EJB3 Spec, section 4.3.13:

          Clients are not allowed to make concurrent calls to a stateful session object. If a client-invoked business
          method is in progress on an instance when another client-invoked call, from the same or different client,
          arrives at the same instance of a stateful session bean class, if the second client is a client of the bean?s
          business interface, the concurrent invocation may result in the second client receiving the
          javax.ejb.ConcurrentAccessException


          S,
          ALR

          • 2. Re: reentrant annotation?
            supert24 supert24 Newbie

            But wasnt there an deployment descriptor tag in EJB 2.1?
            Is it not ported to annotations?

            • 3. Re: reentrant annotation?
              Andrew Rubinger Master

              If I remember correctly...

              Entity Beans could be marked as "reentrant". Session Beans did not require a "reentrant" marking because if Stateless, the container would return another separate instance, and Stateful was prohibited (as it is now)...

              EJB 2.1 Spec, Final Draft, 7.12.10:

              The container must ensure that only one thread can be executing an instance at any time. If a client
              request arrives for an instance while the instance is executing another request, the container may throw
              the java.rmi.RemoteException to the second request if the client is a remote client, or the
              javax.ejb.EJBException if the client is a local client.[9]

              Note that a session object is intended to support only a single client. Therefore, it would be an
              application error if two clients attempted to invoke the same session object.

              One implication of this rule is that an application cannot make loopback calls to a session bean instance.


              S,
              ALR