• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what will happen if an entity bean throws a EJBException inside ejbPassivate?

 
Jack Zhou
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If an entity bean's ejbPassivate is called inside an transaction and the mehtod throws an EJBException, what will happen? Sure this is transparent to client. What a bean provider should do?
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.ejb.EJBException is a runtime exception, so it isn't an application exception, so wouldn't the usual rules for exception handling in bean methods apply? I'd expect the bean to get composted (i.e. transition to the 'does not exist' state). I think spec 18.3.3, pgs 378-379 apply. While the spec culls out container callbacks for special attention, it looks like it follows the same principles of runtime-exception-equals-bean-death as business methods do.
 
Jack Zhou
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, so generally bean provider is neither required nor is able to do something meaningfull.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you always have the option of catching an exception that was thrown to you and doing something about whatever the problem is, but if you decide to let the runtime exception propagate up the call stack, your bean instance is toast.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic