1 Reply Latest reply on Dec 24, 2003 7:11 AM by mclazarus

    Reentrant Bean

    sudhadoesnotexist

      What does it mean to set reentrant value in ejb-jar.xml to true/false?
      a) The bean's code is inherently thread safe and does not require any synchronization mechanisms from the container to protect calls to it

      (or)
      b) This bean's methods will not result in a loopback or call to the same method

      Thanks, Sudha.

        • 1. Re: Reentrant Bean
          mclazarus

          I believe the setting makes the container prevent loopback or reentrant calls into a bean locked in a transaction. As specified in the EJB 2.0 spec 12.1.11 Non-reentrant and re-entrant instances. (page 267 on the PDF I have)

          If the entity bean is specified as non-reentrant in the deployment descriptor, the Container must reject an attempt to re-enter the instance via the entity bean's component interface while the instance is executing a business method. (This can happen, for example, if the instance has invoked another enterprise bean, and the other enterprise bean tries to make a loopback call.) If the attempt is made to reenter the instance through the remote interface, the container must throw the java.rmi.RemoteException to the caller. If the attempt is made to reenter the instance through the local interface, the container must throw the javax.ejb.EJBException to the caller. The container must allow the call if the Bean's deployment descriptor specifies that the entity bean is re-entrant.