Discussions

EJB programming & troubleshooting: Can anyone answer this? No one has to date..

  1. Does anyone out there recommend the use of associating one cmp bean with another bean?

    e.g. A customer bean with an address bean, primary key of customer linking to foreign key of address.

    Is it worth creating two beans and associating them, or is it better to use BMP in one bean.

    I know Websphere has an association utility.

    What's best? What's the advantages of associating CMP beans?
  2. The way that entity beans were designed make it difficult to associate. EJB Spec 2.0 has provisions to help solve this problem, so if you go CMP you may have to wait awhile especially if you are using Websphere. Websphere tends to lag behind the evolving EJB spec. I think with their latest release they are barely compliant with EJB 1.1, and I heard they don't have any plans for being compliant with EJB Spec 2.0 for quite some time. Using BMP, you can associate beans. Your are right about VisualAge, they do some tricky things to associate. I maybe wrong on this, but be careful about using proprietary features like their association feature of VisualAge because they are not portable accross app servers.

    If you absolutely need to use CMP, associate them from the session bean layer. You can't do joins, but it is the closest thing to using BMP and having associations with certain of your entity beans.

    Hope this helps
  3. just to clear some things here. i think websphere 4.0 is completely J2EE 1.2/EJB 2.0 compliant. u might wanna download the version n try it out. i worked on it and i think its damn cool. i have always been impressed by the websphere engine in terms of performance but they have been behind in implementing the specs. but here they are 4.0, with some cool utilities like app assembly tool, log analyser and admin console.

    take care

    kapil
  4. Just to be a little clearer again...

        Was 4.0 is certified at J2EE 1.2 level

        J2EE 1.2 means EJB 1.1 (not 2.0)

    Also, the Association feature in VAJ is portable, you just have to deploy the support classes with your application(they even give you the source):

        com.ibm.ivj.ejb.associations.interfaces
        com.ibm.ivj.ejb.associations.links

    Depending on the application server, you will have to also re-do the custom finders supporting the associations. "Finders" in general are not portable between servers anyway.
  5. thats right, but websphere states that they are EJB2.0 compliant.

    check out

    http://www7b.boulder.ibm.com/wsdd/
  6. The whitepaper describing WebSphere 4.0 only mentions EJB 1.1. There are no CMP 2.0 compliant servers because the spec is still in final draft. Some features of the spec have been implemented on WebLogic for example but it is not yet complete.