2 Replies Latest reply on Oct 10, 2003 1:41 AM by Jochen Cordes

    1:n bidirectional woe

    clarence_chiang Newbie

      Hi,

      I am creating two CMP entity beans with a 1:n bidirectional relationship:

      public class Category ... {

      /**
      *
      * @ejb:relation name="Category-UserAction"
      * role-name="Category-Has-UserActions"
      *
      * @ejb:value-object
      * aggregate="UserActionEntityValue"
      * aggregate-name="UserAction"
      * members="UserActionEntity"
      * members-name="UserActionEntity"
      * relation="external"
      * type="Collection"
      * @jboss:target-relation related-pk-field="id"
      * fk-column="categoryID"
      */
      public abstract Collection getUserActions();

      // then the set method ...
      }

      public class UserAction implements EntityBean {

      /**
      *
      * @ejb:relation name="Category-UserAction"
      * role-name="UserActions-belongs-to-Category"
      * @ejb:value-object
      * aggregate="CategoryEntityValue"
      * aggregate-name="Category"
      * members="CategoryEntity"
      * members-name="CategoryEntity"
      * relation="external"
      * @jboss:relation related-pk-field="id"
      * fk-column="categoryID"
      */
      public abstract CategoryEntity getCategory();
      }

      When I tried to access the UserActionEntity's value object:

      UserActionEntity entity = home.findByPrimaryKey( ... );
      UserActionEntityValue value = entity.getUserActionEntityValue();

      I got a TransactionRollbackLocalException: Reentrant method call detected: UserActionEntity [.1.]

      What did I do wrong ? I have tried various things ... play with xdoclet tags ... set xdoclet tag reentrant="true" ... but nothing works.

      Thanks for all your help

      Clarence