• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger


Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which method can access an enterprise bean in a consistent manner for a container managed stateful session bean that implements the SessionSynchronization interface?

1. constructor()
2. setSessionContext()
3. ejbCreate()
4. beforeCompletion()
5. afterCompletion()

The correct is 4 - afterCompletion()

But according to page 196 of the HF EJB ejbCreate() can access another bean's menthods. Please advise.
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More surprises! Refer to the table in Page:80 in the spec. ejbCreate() and beforeCompletion() are allowed to access EJBs.
[ March 21, 2005: Message edited by: Keerthi P ]
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there Parmeet,

Its talkin about consistancy, when I came accross this question on ejbcertificate.com, here is what I thought and answered right.

1)constructor : cant access
2)setSessionContext: cant access
3) ejbCreate: you can access, but remember its CMT with stateful bean ..this will create problems when called method asks for client context and caller has anything like NotSupported, Never, Supports.
4)beforeCompletion: damn correct......dont need explaination..(its correct)
5)afterCompletion: simply incorrect...dont need explainagion( he he).

Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic