• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

what is Container-managed persistence (CMP) for entity beans

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone explain me what is meant by
Container-managed persistence (CMP) for entity beans
 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An entity bean is a representation of data, usually stored in a single record of a single table of a relational database. It can perform normal database CRUD (create, remove, update, and delete) operations, as well as "finder" operations. BMP entity beans have these operations coded into the bean class, usually using JDBC. CMP entity bean let the container do this work, using hints the bean provider and assembler put into the deployment descriptor.

I hope that's clear. Generally speaking, you're going to get better response on Java Ranch with more specific questions. If you're interested in learning basic concepts, I recommend getting a copy of Heads First EJB or any other book, or perusing online tutorials. Good luck!
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Reshu,

I guess you are in teh starting stages. this is the simplest way i could explain that...

Persistent Store is something like a databse usually..

CMP stands for Container managed persistence which means the calls to teh database are managed by the Container. The entity beans are used to access the data something like customer name, address and id stored in a database table. To get access to teh database u need a connection rite. Usually with BMP u use the JDBC(Java Database Connectivity) commands. But with CMP the calls related to the connections for the database are all handled by the container..

In simple words, Entity beans are used to get the data from the database and the connections to the database (persistence) are all handled by the Container in CMP... Whenever u see persistent store replace it mentally with database and u wud find it easier..

Cheers,
Saagar.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding more to the posts earlier note that, with BMP you still get the connection from the container and the container manages the connections. Also, things like when a bean has to be stored or retrieved from the database are the same for CMP and BMP. The difference is that in BMOP you write the queries that need to be executed for doing the CRUD operations. With CMP the container generates the queries for you.
 
Arun
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding more to the posts earlier note that, with BMP you still get the connection from the container and the container manages the connections. Also, things like when a bean has to be stored or retrieved from the database are the same for CMP and BMP. The difference is that in BMOP you write the queries that need to be executed for doing the CRUD operations. With CMP the container generates the queries for you.
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic