3. How does Stateful Session bean store its state ?
A stateful session bean have three possible stages in its life cycle, namely: i. does not exists, ii. ready and iii. passive. The state of the bean is to stored in memory when in ready state, while stored in a secondary storage when passivated by calling ejbPassivate method on the bean. When the bean is activated again by calling ejbActivate its state is restored back.
4. Why does Stateless Session bean not store its state even though it has ejbActivate and ejbPassivate ?
There are only two stages in the life cycle of a stateless bean, namely i. does not exists and ii. ready. ejbActivate and ejbPassivate will never be called hence their state will nover be saved.
5. What is Entity Bean?
Entity bean represents a business object in a persistent storage mechanism. An entity bean typically represents a table in a relational database and each instance represents a row in the table. Entity bean differs from session bean by: persistence, shared access, relationship and primary key. There are two types of entity beans: container managed and bean managed.
6. When to use session, entity and message driven beans?
Session beans are used to represent a business procedure and no persistance
Is required. Session bean represents a client in the server. Entity beans represent a business logic compared procedure. Entity beans are typically shared between several session beans and persist beyond the scope of the application.
Message driven beans are new in j2ee 2.0 and are asynchronous beans typically
used to inteact with legacy batch processing systems.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment