• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JPilot,, Java ranch exam question ID: 17

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which statements about stateful and stateless session beans are true?

A.Only stateful session beans support transactions.

B.Only stateful session beans can be passivated.

C.Only stateful session beans have a 'setSessionContext' method.

D.Both stateful and stateless session beans can support overloaded 'ejbCreate' methods.

E.Both stateful and stateless session beans can implement the 'javax.ejb.SessionSynchronization' interface.

F.Both stateful and stateless session beans can have instance variable state.

Correct answer B,F.

I think D is correct answer since even a stateless session bean can have overloaded ejbCreate() method, just thet the ones having arguments will nevcer be called.


Answer F is a bit tricky: it is true that both stateless and stateful SB can have instance variables. But what is the meaning of "instance variable state"? Since stateless session beans do not maintain state ...

Miki
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I think D is correct answer since even a stateless session bean can have overloaded ejbCreate() method



EJB specs page 87

The home interface of a stateless session bean must have one create method that takes no arguments. There can be no other create methods in the home interface. The session bean class must define a single ejbCreate
method that takes no arguments.



But what is the meaning of "instance variable state"?




The instance variable that you can deifine in your stateless session bean can hold some values. That is what instance variable state means.

Hope that helps.

Sawan
[ June 25, 2005: Message edited by: sawan parihar ]
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sawan.

Miki
reply
    Bookmark Topic Watch Topic
  • New Topic