Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

JPilot Mock Exam Question - Help Needed!

 
Ranch Hand
Posts: 108
  • 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.

Select 2 answers

I can think only B is correct. But in the exam says B and F both are correct. How stateless session beans can have instance variable state.

Could some one can explain me about the same?

Thanks,
Seenu
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Seenu,

Stateless session beans can have state in their instance variables but they cannot contain state specific to a particular client.

Refer to EJB 2.0 Specification section 7.8 page #87 which says,


The term �stateless� signifies that an instance has no state for a specific client. However, the instance
variables of the instance can contain the state across client-invoked method calls. Examples of such
states include an open database connection and an object reference to an EJB object.

 
Seenu Reddy
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pranav Shukla,

Thanks for your response. I got the point and i miss interpreted the point.

Thanks,
Seenu
 
Good night. Drive safely. Here's a tiny ad for the road:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic