What advantage does an entity bean have over a sessin bean?

Answer Posted / gaurav

An entity bean represents an entity such as an employer,
student, etc. A session bean is a type of EJB (Enterprise
JavaBean) that encapsulates the logic of a business process
and business rules. Entity beans offer the following
advantages over session beans:

Persistence: Entity beans are persistent, i.e., the state
of the bean exists beyond the lifetime of the application
or the application process. There are two types of
persistence: Bean-managed and Container-managed. In Bean-
managed persistence, the code contains the calls that
access the database. In Container-managed persistence, the
EJB container generates the database calls.
Shared Access: Multiple clients can share the entity beans.
It works within the transactions as the client changes the
data.
Primary Key: Each entity bean has a unique object
identifier that enables the client to locate a particular
entity bean.
Relationship: An entity bean can relate to other entity
beans. Both CMP and BMP can be used to maintain
relationships.

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is class level lock ?

684


How do you reverse a word in java?

611


When should I use stringbuffer?

653


Difference between a process and a program?

697


What restrictions are placed on method overloading?

724






Can we use string in switch case in java?

666


Is a boolean variable?

608


What is byte [] in java?

638


What is method with example?

664


Will the jvm load the package twice at runtime?

672


Is java platform independent?

655


What are the Main functions of Java?

700


How many characters is 16 bytes?

621


What's a method in programming?

631


Is boolean a data type in java?

612