Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

BMP and CMP for database access  RSS feed

 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, I want to understand how is BMP and CMP different. Is it like BMP (bean managed persistence) is within EJB layer only and CMP (container) is also for web container? Please give an example of both.

Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, they both live in the EJB layer. But with BMP the bean itself is in charge of saving itself to permanent storage. In other words, the developer (or the IDE) must write the code to read and write the bean's data. Since for most applications that use relational DBs that's a bunch of boilerplate code, just about everybody uses CMP (where the EJB container takes care of loading and saving the bean).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!