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

remove AND ejbLoad

 
William Silva
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
If the client simply call remove method on the
EJBObject to remove the entity data in database by its primary key,why
ejbLoad is neccesary?
I'm using JBoss and BMP.
Thanks,
William.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
William Silva
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Reid,
Thanks a lot !!!
I forgot about the relationships !
William.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic