Stateful bean mock ques..

which of the following requiremtns make it mandatory to use stateful session bean instead of stateless session benas.

1.The container should be able to use any instance from the pool to process client's request. 2. session bean reads and updates the database on behalf of the client. 3.The client wants to control the lifecycle of the session bean. 4.The session bean should be notified of transaction boundary events.

Originally posted by mallika shah: NEed some clarification on this question..any help appreciated.

which of the following requiremtns make it mandatory to use stateful session bean instead of stateless session benas.

1.The container should be able to use any instance from the pool to process client's request. 2. session bean reads and updates the database on behalf of the client. 3.The client wants to control the lifecycle of the session bean. 4.The session bean should be notified of transaction boundary events.

Ans according me was 2,3 But the given answers are 3,4

Why is 2 wrong??

mallika

Hi,

You can read and update the database in stateless sessions beans too. To control the creation and destruction of session bean is required stateful session beans. Also,transaction boundary events notification is only possible if stateful session implements SessionSynchronization interface.