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

Doubt regarding Stateful Bean Passivation

 
Amresh Singh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Spec says, by the time ejbPassivate() completes for a stateful session bean, all bean instance variables MUST be assigned either a serializable instance, a null value or instance of some resource manager connection factory etc.

My question is, when it says MUST, what does it mean: A compilation error, an EJB compilation error(at deployment) or run time error.

Thanks
Amresh
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amresh,

it won't throw any compilor exception but when you/container reactivate the bean, bean instances will lose all the values that had before passivation. This is significant mistake. So that is why probably they use 'MUST'.

Thanks,
Ugender
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No compilation error , You may expect a runtime non serializable exception , though the specification doesn't say that during passivation the container has to do a java serializable , it may choose to do something other than serializable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic