Difference between container-managed & bean-managed
persistence?

Answers were Sorted based on User's Feedback



Difference between container-managed & bean-managed persistence?..

Answer / janet

In container-managed persistence, entity bean data is
automatically maintained by the container using a mechanism
of its choosing. For example, a container implemented on top
of an RDBMS may manage persistence by storing each bean?s
data as a row in a table. Or, the container may use Java
programming language serialization for persistence. When a
bean chooses to have its persistence container managed, it
specifies which of its fields are to be retained.

In bean-managed persistence, the bean is entirely
responsible for storing and retrieving its instance data.
The EntityBean interface provides methods for the container
to notify an instance when it needs to store or retrieve its
data.

Is This Answer Correct ?    16 Yes 1 No

Difference between container-managed & bean-managed persistence?..

Answer / john doe

In a CMP the task of mainitain the persitance is carried out
completely by the container. It is simpler for the developer
as the most of the tasks are handled by the contianer
itself. The developer does not have to worry about
connectivity or the JDBC

In a BMP the developer has to use database APIs to read or
write data into the DB. This gives him the flexibilty to
carry out the persistance operations which are too
complicated for the container to handle. He has to use EJB
QL (EJB Query Lanaguage) to interact with the database using BMP

Is This Answer Correct ?    11 Yes 4 No

Post New Answer

More EJB Interview Questions

The ejb container implements the ejbhome and ejbobject classes. For every request from a unique client, does the container create a separate instance of the generated ejbhome and ejbobject classes?

0 Answers  


What do you mean by EJB architecture?

0 Answers  


What are the attributes of transaction in ejb?

0 Answers  


how can we decide a session bean as stateless or stateful without seeing jar file? i.e. by seeing the class file.

3 Answers  


Explain the concept of ejb ql?

0 Answers  






What is the difference between stateful and stateless session beans?

2 Answers   Tech Mahindra,


Which is more beneficial: CMP or BMP?

0 Answers  


What causes statelessness?

0 Answers  


how to deploy enterprise javabeans?

2 Answers   Inforica,


Define SessionContext ?

0 Answers  


What is the major difference SessionBean and EntityBean?

3 Answers   KPIT, Wipro,


What is mdb?

0 Answers  


Categories