File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why so many remove()

 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still trying to figureout why EJB specs have provided so many removes.

Is it something that I might be missing in uderstanding the purpose of all removes.

EJBHome -> remove(Handler handler)
remove(Object object)

EJBObject -> remove()

EntityBean, SessionBean - > ejbRemove() that I need to implement remove in my bean class.

How are all these removes used.
why so many removes.

secondly, for all remove HFEJB tells that call this to remove the bean.
with exceptions for statless and entity beans.
 
Poobhathy Kannan
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBHome -> remove(Handler handler),remove(Object object)
-Client says to Home to remove bean which created from that home.

EJBObject -> remove()
-Client says to remove the bean which associated to this EJBObject
 
Chengwei Lee
Ranch Hand
Posts: 884
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

EJBHome -> remove(Handler handler)
remove(Object object)

For entity beans removal, the client/another bean would usually invoke the remove(Object pk) method. The primary key of an entity bean can be obtained easily via the getPrimaryKey method.

Since session beans & MDB do not have any primary keys, the remove(Object pk) method obviously won't work. So another remove(Handle h) method was needed.


EJBObject -> remove()


One of the reason that this remove method exists is that local session beans & local MDB do not have handles, that means we cannot use remove(Object pk) & remove(Handle h). If the remove method wasn't provided, they would be no way we could remove these beans!

HTH.
 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the inputs
This removes the confusion.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem. Don't forget to read the specifications. They helps a lot.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic