• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ETS Question on session bean

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic