Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HF: page 371, a Entity Bean question.

 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Which method(s) run in the transaction context of the method that causes their invocation?

a) ejbLoad()
b) ejbRemove()
c) ejbSelect()
d) ejbActivate()
e) ejbPassivate()
f) setEntityContext()

Correct answers are a, b,c.

I thought answers are a,d,e. Can somebody please explain it?

Thanks,
Prashant
 
Kin Ng
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer can't be ejbActivate and ejbPassivate.

Because by the time ejbActivate() or ejbPassivate() is called,
the container no longer has you in a meaningful transaction context,
Thus, you can't be in a transaction at that point.

Business methods, home business methods and remove() of entity beans
should be running in transactions. I guess that's why
the answer is a,b,c
 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Kin. I understood the question wrongly.

--Prashant
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic