• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Interface for Destroy method in EJB

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which Interface is used to destroy the instance of EJB bean :
1. Home Interface
2. Remote Interface
or other than the 2 mentioned above.

Please reply,

Thanks
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you look at both EJBHome and EJBObject api you can see that both the interface removes the EJB instance. From home interface you remove the instance by passing the handle of the EJB instance. One difference you need to know is both these interface cannot remove the stateless bean.
 
Ranch Hand
Posts: 502
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Client has access to only those interface you mentioned by its implemented classes. Using those he can do some action on bean and remove() method is from only from EJBHome and EJBObject,EJBLocalHome and EJBLocalObject interfaces.

So, client can only call remove() from Home and Component Interface. One more way bean can be removed is, if System Exception or Uncaught exception is thrown.


hth,
 
ramya ray
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok so both EJBHome and EJBRemote interface can be used to remove EJB instance ?

Please confirm.

Thanks,
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Needless to say, you have to invoke remove() on EJBObject (or EJBLocalObject) interface.
But, the consequence is,
1. The actual bean is removed if its stateful bean
2. The acutal bean is sent to pool, if its a stateless bean.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic