5 Replies Latest reply on Jul 31, 2004 1:10 PM by Tomer ben david

    getEJBLocalObject, CMR, ejbPostCreate, and Reentrant method

    Tomer ben david Novice

      Hi

      I have two entity beans.
      they have a CMR (bidirectional) one to one.

      In entity1 ejbPostCreate im creating an entity2 and assigning entity1 to it like this pseudo code

      class Entity1Bean {
      
       ejbPostCreate(...) {
       // Every time I create entity1 entity2 should be created and point to entity 1.
       entity2Home.create((Entity1) entityContext.getEJBLocalObject());
       }
      
      }
      


      I receive an exception for that :

      javax.ejb.EJBException: Reentrant method call detected for User 1: The same thre
      ad reentered: thread-holder=Thread[RMI TCP Connection(82)-10.10.1.80,5,RMI Runti
      me], holding tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=WS-TBENDAVID//18
      03, BranchQual=], current tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=WS-
      TBENDAVID//1803, BranchQual=]
       at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentr
      anceInterceptor.java:108)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstance
      Interceptor.java:175)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
      .
      .
      .
      


      What can I do to overcome this?