Discussions

EJB design: Can you use CMP and BMP Entity Beans in the same J2EE Server?

  1. Most of my design works perfectly fine with CMP Entity Beans, but I need access to a legacy system. I decided to access the legacy system via Web Services from what I read I can wrap my Web Service inside a BMP Entity Bean that extends a CMP Entity Bean. Applying Enterprise JavaBeans (2003)

    So, can I have both of them within the same container?

    Thanks

    Izak
  2. Yes...you can use BMP as well as CMP beans within the same container. It is recommended that for read-only EJBs, BMP performance is much better than CMP because of the overheads associated with CMP. Other than that, it is a matter of design/choice to use BMP, CMP or BMP/CMP within an Application.

    -Shreeram Iyer
  3. What a crock of sh[ Go to top ]

    "It is recommended that for read-only EJBs, BMP performance is much better than CMP because of the overheads associated with CMP"

    I'd be a bit wary about listening to the person who gave this recommendation.

    The BMP argument where you code the SQL yourself is not much better that using stateless session beans with direct SQL.

    Are you going to build the caching yourself? CMP (a decent implementaion such as WLS 8.1) has built in caching so you don't have to worry about it.

    Contrary to this recommendation, once of the things CMP (WLS anyway) excels at is read only beans.
  4. What a crock of sh[ Go to top ]

    Are you going to build the caching yourself? CMP (a decent implementaion such as WLS 8.1) has built in caching so you don't have to worry about it.

    >
    > Contrary to this recommendation, once of the things CMP (WLS anyway) excels at is read only beans.

    Well to be honest, I haven't got as far as caching yet - but many books recommend that I use CMP caching facilities so I am not too worried about it.

    As far as read only beans are concerned, just to clarify, is that entity beans that say for example access data based in a legacy system / database to which you only want to grant read only access?

    Regards,

    Izak