Title: ejbPostRemove()?
Hi Charles,
 
There are a lot of practical issues if such a provision is provided. The fundmental one being how does B get a reference to A in the ejbPostRemove(). The ejbRemove() method does not take any argument so the postRemove will also not have input arguments. Since the ejbRemove has already been called the abstract getter method (in case of a bidirectional relationship ) to get a reference to A should return null as both would be a part of the same transaction.
 
AK.
----- Original Message -----
Sent: Wednesday, June 05, 2002 11:43 PM
Subject: ejbPostRemove()?

During a discussion with a colleague today we considered a situation where it would be nice to have a method, defined in the bean class itself, which performs cleanup after an EJB instance is removed. For example, if A has 1-many relationship with B, and A has a persisted status value based on the minimum of one attribute on its collection of Bs, then when an instance of B is deleted, A needs to recompute its status -- after the B instance is deleted.

Of course, this "business" logic could be defined in a session bean method, of course, but the nature of the relationship between A and B is fundamental to their existence, so shouldn't it be coded in the entity bean classes themselves?

The natural name for such a method would be ejbPostRemove, for symmetry with the spec-defined ejbPostCreate.

Charles May

*****************************************************************           DISCLAIMER:   The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee.  Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized.  If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.   

Reply via email to