• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using CMP and BMP together

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Could anybody please let me know if there could be any problems with using CMP's and BMP's together in a project.
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on your Application Server, the relationship between those beans could become harder to manage than pure CMP.

Just my two cents.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CMP and BMP can definitely live together. In fact, it is preferred in those cases where you have a fairly old application based on BMP that you would like to move to CMP. Instead of doing it all in one shot it is better to take the change a little here, change a little there approach.
You should also be aware that BMP beans cannot participate in CMR (Container Managed Relationship), this is probably what Edy was referring to.
 
D Singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Edy for a quick reply
We are using Websphere 4.0 and Oracle. We have to execute some stored procedures, for which I plan to use BMP's and for general simple database queries use CMP's. I hope this could be practically achieved without any issues or is there any alternative to this ?
Please suggest.
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by D Singh:
Thanks Edy for a quick reply
We are using Websphere 4.0 and Oracle. We have to execute some stored procedures, for which I plan to use BMP's and for general simple database queries use CMP's. I hope this could be practically achieved without any issues or is there any alternative to this ?
Please suggest.


This solution would work fine. Though I would probably execute the stored procedures directly from the Session Bean layer. You are using Session Facades on top of your Entity Bean layer, right?
 
D Singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah Chris session bean would wrap entity beans.
I think you are right stored procedures should be executed through the controller which is the session bean, but my only concern is that if we have any complex queries to be executed the preferd way is to use BMP's (I think )as we are using EJB 1.1 architecture, could this cause any design or architectural problem as session bean would sometimes call CMP's and sometime BMP's ?
If there are any concerns how could we tackle them ?
 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no prefered way to execute complex data base quires. You could do that in BMP entity beans. You could do that in session beans also. In fact, if you do that in stateless session bean, the performance will be enhanced a lot and development will be much easier, given that you can live with the fact that session beans can not survive server crash.
In old days, EJB1.0 and even EJB 1.1, stateless session beans were the most popular EJBs selected by many projects because of the performance problem with entity and stateful session beans.
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic