2 Replies Latest reply on Feb 1, 2003 9:02 AM by petertje

    CMR - Only Local Interfaces Supported?

    raja05

      Hello
      Im trying to test a simple bidirectional relationship between two tables using Jboss 3.0.4.
      Both the CMPs are remote objects and this is the code in the ejbPostCreate of one of them

      public void ejbPostCreate(String id, String name, String manager, DepartmentRemote remote) throws CreateException {
      setDepartment(remote); //Department is Remote Interface
      }


      This throws a classcastexception and when i lookup the source code corresponding to the exception trace, i see that it looks for a EJBLocalObject there. Here is the code snipper from JDBCCMRFieldBridge


      while(newBeans.hasNext()) {
      EJBLocalObject newBean = (EJBLocalObject)newBeans.next();
      createRelationLinks(myCtx, newBean.getPrimaryKey());
      }



      So my question is should the relation beans only be local?

      Thanks
      Raj

        • 1. Re: CMR - Only Local Interfaces Supported?
          raja05

          To Follow up, I did create a Session Facade and made all my CMPs Local interfaces and it worked fine.

          can someone confirm that remote interfaces cannot be used for relationships in CMP?

          Thanks
          Raj

          • 2. Re: CMR - Only Local Interfaces Supported?

            > can someone confirm that remote interfaces cannot be
            > used for relationships in CMP?

            That is right. Check chapter 10.3.2 (and 10.3.1) from the ejb (2.0) spec. One quote from this section:
            "Container-managed relationships are defined in terms of the local interfaces of the related beans."

            Peter.