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
As answered by Giju, third point is applicable for both the stateless and statefull beans, hence could not be part of the answer.
posted 15 years ago
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.
James [ September 02, 2004: Message edited by: james edwin ]