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

Dout about EJBHome.remove(Handle h) for entity beans

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

Thanks.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Section 10.5.1:

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
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Valentin Crettaz:
Section 10.5.1:


When ejbRemove() is invoked, the row in the database is deleted for sure


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic