2 Replies Latest reply on Mar 27, 2002 12:54 PM by Tim

    foreign key mapping in JBoss3.0.0beta

    Tim Newbie

      Hi,

      (1 possible bug detected and 2 issues I cam having)

      1)

      Just to let you know that there seems to be a bug in JBoss 3 beta.

      It seems to ignore me trying to force the naming of cmr-field (foreign key) columns in the database.

      Originally I let JBoss handle the naming itself. In Alpha it chose something like "interest_interestpk" as the name, where "interest" is a CMR field to InterestLocal. This was ok.

      I have switched to JBoss beta because of problems with EJB-QL in alpha. It now names the column as "interest". The problem I had with this was the fact that the database I am creating is sometimes accessed by people using the alpha version (we haven't all made the switch yet). So I decided to force the mapping by modifying the jbosscmp-jdbc.xml file (and jaws.xml - I'm making the two identical atm... which I still have to correct and find out what I AM SUPPOSED to do, but that's another days work). This had no effect in Beta but when I tried it on Alpha it worked ok.

      Therefore I think the foreign key mapping is broken in JBoss beta. I will try in on the latest CVS version if I have time.

      2)

      Another issue I have is that the beta version does not like the following ejb-ql syntax, can anybody see a reason for this?

      <query-method>
      <method-name>ejbSelectMemberInterest</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      <method-param>ie.emuse.ichara.server.entity.InterestLocal</method-param>
      </method-params>
      </query-method>
      <ejb-ql>
      <![CDATA[
      SELECT mi
      FROM MemberEJB AS m,
      IN( m.interests ) AS mi
      WHERE m.memberPk = ?1 AND mi.interest = ?2
      ]]>
      </ejb-ql>

      - interests is a cmr field setup as a Set of MemberInterests

      - Method call is:
      public abstract Set ejbSelectMemberInterest(Integer memberPk, InterestLocal interest) throws FinderException;

      3)

      The beta version seems a little less stable to me than the alpha version. Not so much in continuous runtime, but when an application is being redeployed. Sometimes it will just bomb out when attempting to redeploy the new application. It also requires that "tmp" be cleared out before restarting the server. Has anyone else experienced this?

      How long before another, more stable, beta release... or even final release? Any ideas?

      Many thanks and all the best,

      Tim

        • 1. Re: foreign key mapping in JBoss3.0.0beta
          Tim Newbie

          BAck again,

          After spending a few hours getting the latest version of JBoss from CVS I have made progress. The EJB-QL statement I had was okay except for the fact that I needed OBJECT(mi).

          The foreign key mapping does not seem to be working still.

          Overall though, I am impressed with the current version of Beta2. The ejb-ql checking is much better and it seems a lot more stable. I think I'll probably make the switch over.

          Keep up the good work.

          Tim

          • 2. Re: foreign key mapping in JBoss3.0.0beta
            Tim Newbie

            You know, I really feel silly sometimes. My problem with the foreign key mapping was that I had the key-fields section in the wrong relationship role of each relation. I had basically just copied them from the ejb-jar file and reworked the syntax without actually thinking through it. Nicely, beta2 was complaining about having the key-fields on the many field and I couldn't figure out what was wrong until I started looking at some examples in the testsuite code. Very silly of me really but it's all a learning curve.

            The change has now been made to beta2 and all is well so far.

            Sorry for the previous posts but this might help others who are being equally brief in their checking of xml code!

            Cya

            Tim