Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

www.ejbcertificate.com

 
rani bedi
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.
 
Keerthi P
Ranch Hand
Posts: 203
  • 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 ]
 
amol deshpande
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).

Amol.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic