• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
rubbery bacon. crispy tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic