4 Replies Latest reply on Nov 11, 2002 11:41 AM by Brian Archer

    CMR across jars

    Brian Archer Newbie

      I guess this is probably a question of the CMP2 spec as well as JBoss's implementation.

      I am trying to modularize my application by logically separating my beans into different jars. My problem is that I have a specific bean named Annotation that is referenced by almost every other bean via CMR. Does anyone know whether or not it is allowed to create a relationship across multiple deployment jars? Both jars will always deployed on the same machine (obviously or this would never work).

      It just seems rediculous to have to put all of my beans into a single jar. This would force me to deploy my entire application every time a change is made to one bean.

      Any help will be greatly appreciated.

      -Brian

        • 1. Re: CMR across jars
          Gofio Gofio Newbie

          Hi Brian,

          I have exactly the same problem. I have been searching for a solution and it looks like the CMP2 specification has this restriction: the cmr is between beans in the same ejb jar.

          Can anybody tell me if the JBOSS implementation has this restriction... Could it be used between beans in the same ear file?

          Please, if somebody can tell me something about this issue I will appreciate it very much !!!

          jGofio

          • 2. Re: CMR across jars
            rk Newbie

            Hi,
            I had the same problem as well. The only thing I can suggest is to have a xml file for all the persistence (CMP) and have a separate xml for every session bean.

            • 3. Re: CMR across jars
              Brian Archer Newbie

              Actually, after reading the spec, jars are never mentioned as far as I could see. It does say the following: "Container-managed relationships can exist only among entity beans within the same local relational scope, as defined by the element in the deployment descriptor". It could be interpreted to mean that the 'local relational scope' means the same descriptor or the same jar. However, this is merely one interpretation. There's nothing that says an implementation couldn't acknowledge all entity beans deployed on the same machine as being part of the same 'local relational scope'.

              Does anyone know if this issue been brought up with Sun as a JSR? It wouldn't be the first mistake Sun has made (e.g. remote/local interfaces requiring code changes).

              It looks like for now I'll be managing some of my relationships myself in the session layer until somebody at Sun or JBoss decides to circumvent this problem. Thanks for all the replies so far. I'm still interested in hearing other thoughts on this subject. I wonder how many people are actually using CMR in production code these days?

              Regards,
              Brian

              • 4. Re: CMR across jars
                Brian Archer Newbie

                Hello rakn. Thanks for the reply, although I don't understand your suggestion. Could you please explain?