• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

remove in HOME Interface

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that remove in the Component Interface actually removes the bean (Session/ Entity - row ). What does remove in the Home interface do ? Geting confused by too much learning .... (Just started preparing for the SCBCD )
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Home interfaces act as object creation factories and they define bean life cycle methods, like create, remove, find, etc. The container gets a bean instance from the pool in order to service home methods; this saves the overhead of creating unnecessary bean objects. This could also be a very efficient way to remove rows, without finding the corresponding beans and calling remove on their remote interface. It is also very useful for removing beans when the handler is passed.
The funny story is that because both entity and session bean home interfaces extend the EJBHome interface they will also get the implementation for remove methods. There are two of them: one that works for entity ejbs only and takes a pk and another one that takes an ejb handler. Because session beans don�t have pks, calling the remove and passing a fake pk will mostly force the container to throw an exception (check your container documentation for that).
Regards.
 
Lakshmi Anantharaman
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting ... Thanks
reply
    Bookmark Topic Watch Topic
  • New Topic