This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPilot,, Java ranch exam question ID: 17

 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • 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
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Sawan.

Miki
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic