Forums Register Login

Why so many remove()

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
 


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.
+Pie Number of slices to send: Send
Thanks for the inputs
This removes the confusion.
+Pie Number of slices to send: Send
No problem. Don't forget to read the specifications. They helps a lot.
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 811 times.
Similar Threads
Interesting Mock Exam Question - HFE 652 (Suman can you answer this)
Doubt in poll()
Couple of questions
Can Java do this with console?
Stateful session bean + @Remove [EJB3]
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:35:01.