Short answer: The spec explicitly requires it. Longer answer: because you are talking about an entity bean, the container is being asked to perform a business operation, it isn't just randomly doing some house-keeping of its own (e.g. calling ejbRemove on a stateless session bean would just be an aspect of container-determined housekeeping). It is being asked to remove an entity, which can mean a lot more than simply removing a row in the database. You might have a relationship to update, you might have an audit log to update, etc. Besides, at the end of the day, the spec says that ejbRemove is invoked on an instance that isn't in the pool, but is in fact the instance representing the entity, so the container is going to end up activating the instance and loading the data in order to establish that there is even such an entity in the first place. [ February 19, 2004: Message edited by: Reid M. Pinchback ]
Reid - SCJP2 (April 2002)
posted 16 years ago
Hi Reid, Thanks a lot !!! I forgot about the relationships ! William.
-----------------------<br />William W Silva<br />SCJP<br />SCWCD<br />SCBCD
I child proofed my house but they still get in. Distract them with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!