Reentrance in EntityBean

Discussions

EJB programming & troubleshooting: Reentrance in EntityBean

  1. Reentrance in EntityBean (2 messages)

    Why do we have an option of Reentrance in entity bean.Though its not advisable for an entitybean to be reentrant, i'm wondering under what circumstances a bean can be reentrant.

    Siva
  2. Concurrent calls in the same transaction context on the same
                Enterprise JavaBean component are illegal and may lead to
                unpredictable results. A bean can be marked as non-reentrant by its
                deployment descriptor. This allows the container to detect and
                prevent illegal concurrent calls from clients. On the other hand,
                some entity beans may require loopback calls: that is, calls where
                bean A is invoked, in turn invoking bean B, which then invokes a
                method call on bean A. This kind of concurrency is tricky and is
                best avoided.



    Ex .To Invoke CMT's The container can instantiate multiple instances of the bean and let the transaction management of the DBMS handle transaction processing.
  3. Can u give a real time example of a loop back scenario using two entity beans.
    i have never experienced a case where A entity bean object calling B entity bean object and B calling back A entity bean object with in same transaction context.i could't think a case where such possibility would come in real world applications.Pl enlighten on this.

    Siva