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

ques on ejbRemove()

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container synchronizes the instance�s state before it invokes the ejbRemove method

I still can't understand why the container has to do all these.. when it's going to delete the entity from db and move the bean instance (to the pool)
 
Severin Stoeckli
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spec 172:

The entity Bean Provider can use the ejbRemove method to implement any actions that must be done before the entity object�s persistent representation is removed. The container synchronizes the instance�s state before it invokes the ejbRemove method. This means that the state of the instance at the beginning of the ejbRemove method is the same as it would be at the beginning of a business method.


If not, the bean provider would not know the exact state of the entity. sounds reasonable?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container needs a synchronization in ejbRemove method because it can be necessary to execute a cascade-delete or something else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic