This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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.
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic