This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes CMP vs BMP - data store independence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "CMP vs BMP - data store independence" Watch "CMP vs BMP - data store independence" New topic
Author

CMP vs BMP - data store independence

s khosa
Ranch Hand

Joined: May 15, 2003
Posts: 72
Hi,

If you are desinging an EntityBean and your data is going to be stored in more than one data source which approach would u take CMP or BMP?? I thought CMP would be the way to go because in BMP you would end up hardcoding ur connection pool, jdbc driver, sql etc etc....

I understand also that for CMP one would need to define container column mappings to database. Not sure which is the ideal way..:-(

Any pointers???

Thanks
Harini Shree
Greenhorn

Joined: Feb 14, 2006
Posts: 14
I belive BMP is the ideal way. As we have more control over the data handling. Correct me if Iam wrong.

Regards,
Harini.
Paul Codillo
Ranch Hand

Joined: Aug 21, 2002
Posts: 38
If you are desinging an EntityBean and your data is going to be stored in more than one data source which approach would u take CMP or BMP?? I thought CMP would be the way to go because in BMP you would end up hardcoding ur connection pool, jdbc driver, sql etc etc....

I understand also that for CMP one would need to define container column mappings to database. Not sure which is the ideal way..:-(

Not necessarily. You may define your data source outside your Java code (like on your app server) and access it via JNDI. That way, you don't need to hard code your connection details. You may want to you use BMP if you want finer control over your transactions, but if you simply need a per method transaction control, I guess CMP will be more efficient.

Cheers!

Paul


paul.com<br />SCJP, SCWCD, SCBCD, SCEA
rinsad ahmed
Greenhorn

Joined: Mar 16, 2006
Posts: 12
Paul

I think you are messing BMP & CMP with BMT & CMT. Please correct if I am wrong


Rinsad<br />B.Sc.(Eng)Hons.(Computer Science & Engineering)<br />SCEA 97/90
Raghubir Bose
Ranch Hand

Joined: Feb 18, 2006
Posts: 88
Khosa,
Please go thru' this , this will answer your question.

--Bose


I will meet the fairy queen soon !
Raghubir Bose
Ranch Hand

Joined: Feb 18, 2006
Posts: 88
http://java.sys-con.com/read/43552.htm

sorry forgot to paste the link ...
 
GeeCON Prague 2014
 
subject: CMP vs BMP - data store independence