What advantage does an entity bean have over a sessin bean?
Answers were Sorted based on User's Feedback
Answer / uppi
Entity Bean is a Java class which implements an Enterprise
Bean interface and provides the implementation of the
business methods. There are two types: Container Managed
Persistence (CMP) and Bean-Managed Persistence (BMP).
Session Bean is used to represent a workflow on behalf of a
client. There are two types: Stateless and Stateful.
Stateless bean is the simplest bean. It doesn't maintain any
conversational state with clients between method
invocations. Stateful bean maintains state between invocations.
Is This Answer Correct ? | 19 Yes | 5 No |
Answer / tarunam verma
entity beans are generally used for database interaction
thus provide various EJB services like
transctions,persitence etc which using the seesion bean
will be manully handeled by the programmer while
interacting with Db,session beans are basically for
processing the logic not for DB entities
Is This Answer Correct ? | 15 Yes | 2 No |
Answer / 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 |
Why java doesn’t support multiple inheritances?
What is Co-Variant return type in method overriding?
Explain the difference between protected and default access.
Is singleton thread safe in java?
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
what is an object class?Explain its methods?
What does file separator do in java?
Why a dead thread occurs?
What are the data types supported by java? What is autoboxing and unboxing?
What is role of void keyword in declaring functions?
Definition for connection pooling?
How define set in java?