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


      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)-,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
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstance
       at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep

      What can I do to overcome this?