• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbcertificate.com question

 
Vaithiya Sundaram
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following only apply to stateless session beans?

1 Only one create method can be defined in the session bean's home interface.
2 The container controls the lifecycle of the session bean.
3 The container calls the bean instance's setSessionContext method to pass a reference to a session context interface to store for future use.
4 Each session bean instance is associated with a single client.
5 A transaction can span multiple business method invocations.

I thought 1,2,3. But it says 1 & 2 only.
Please correct me if i am wrong.
Thanks
 
james edwin
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are right,Answers 1,2,3 are correct.

Regards,

James
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following only apply to stateless session beans?

Pay more attention to the ques, it ask about stateless session beans ONLY.

ans 3 is applicable to both stateless and stateful.
 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As answered by Giju, third point is applicable for both the stateless and statefull beans, hence could not be part of the answer.
 
james edwin
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Giju/Narasimha,

But client never calls "setSessionContext()" method directly.It always called by container.

Quote
"
The container instantiates the bean using the newInstance method and then calls the methods setSessionContext and ejbCreate. The container also sets the transaction context and security attributes (as set in the deployment descriptor). Now the bean is ready to serve any client.
"
Unquote

Above session was taken from stateless session bean only.

Cheers !!!

James
[ September 02, 2004: Message edited by: james edwin ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic