Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ETS Question on session bean

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source: ETS (Enthuware)

Which of the following statements are correct regarding any session bean life cyle?
Answers (Choose 2)
1) The context is injected after the bean is created but before the post construct callback method is invoked on that bean
2) Once removed by a client, a stateless session bean cannot be used again to service requests from other clients.
3) Once removed by a client, a stateful session bean cannot be used again to service requests from other clients.
4) For each dependency injection of a stateless session bean in another component, a new instance of the injected bean is crea
5) A container may or may not remove a stateful session bean instance when a client calls remove().
ETS Answer: 1 & 3.
I agree with that. But i think answer 5 is also correct. Consider the scenario. When a client invokes a remove method, container will not remove the instance if the method throws an application
exception and specifies retainIfException=true. Hence answer 5 cannot be ruled out. Since the option 5 itself uses
words like "may or may not" , It further cements the fact the answer 5 is a correct option.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look for the completeness of the sentences. Statement 5 would have been correct if the sentence also said anything about retainIfException attribute of the @Remove annotation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic