What happens if a client invokes the EJBHome.remove(Handle h) on a bean's Home object stub? My doubt refers whether only the EJBObject will be removed, or the underlying entity will be removed.
I understood what happens with EJBHome.remove(Object key)
I think that Figure 19 (p. 118) of the spec illustrates well what happens in this case. When you call remove on the home, the EJB object is still referenced by the container until the latter explicitely releases the reference to it.
Originally posted by Valentin Crettaz: I think that Figure 19 (p. 118) of the spec illustrates well what happens in this case. When you call remove on the home, the EJB object is still referenced by the container until the latter explicitely releases the reference to it.
I looked at the picture on page 118 but it didn't clarify my doubts. If we invoke EJBHome.remove(Handle h), what will happen to the underlying entity (the row in the database)?
The container invokes the ejbRemove() method when the container is removing the entity object (i.e., when the client invoked the remove() method on the entity object�s component interface or a remove() method on the entity bean�s home interface).
When ejbRemove() is invoked, the row in the database is deleted for sure