Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMP vs BMP - data store independence

 
s khosa
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
rinsad ahmed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul

I think you are messing BMP & CMP with BMT & CMT. Please correct if I am wrong
 
Raghubir Bose
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Khosa,
Please go thru' this , this will answer your question.

--Bose
 
Raghubir Bose
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sys-con.com/read/43552.htm

sorry forgot to paste the link ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic