aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Stateful bean mock ques.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Stateful bean mock ques.." Watch "Stateful bean mock ques.." New topic
Author

Stateful bean mock ques..

mallika shah
Ranch Hand

Joined: May 11, 2006
Posts: 164
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
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
mallika shah
Ranch Hand

Joined: May 11, 2006
Posts: 164
thanks Narendra
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Stateful bean mock ques..