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

ejbPassivate() for Stateful session bean

 
Jason Hunt
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to spec, for SFSB, after ejbPassivate(), if there are still some fields not meet the requirements of serialization, the container may choose to destroy the bean instance, so if the clients try to invode the business method on this bean, client gets a ObjectNotFoundException, isn't it ?
 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason,

You are correct in stating that the sfsb is destroyed if the container could not passivate it.

However, when the client invokes a biz method on the bean's component interface (after the bean is destroyed) it will get a system exception rather than javax.ejb.ObjectNotFoundException (which is an application exception thrown from entity bean's single finder methods when an entity with the specified attributes cannot be found in the underlying persistence store):

* java.rmi.NoSuchObjectFoundException - remote clients will get this system exception
OR
* javax.ejb.NoSuchLocalObjectFoundExceptio - local clients will get this system exception


Hope it helps
 
Jason Hunt
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alex, thank you very much, it is all clear now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic