Hi, everyone,
Why there has a method called unsetEntityContext() in EntityBean interface but not has a corresponding method called unsetSessionContext() in SessionBean interface?
-
A Question about SessionBean and EntityBean? (3 messages)
- Posted by: kingbow jb
- Posted on: December 22 2003 21:15 EST
Threaded Messages (3)
- A Question about SessionBean and EntityBean? by sergiu truta on December 23 2003 02:52 EST
- A Question about SessionBean and EntityBean? by sergiu truta on December 23 2003 02:55 EST
- A Question about SessionBean and EntityBean? by Manish Gupta on December 27 2003 06:34 EST
- A Question about SessionBean and EntityBean? by sergiu truta on December 23 2003 02:55 EST
-
A Question about SessionBean and EntityBean?[ Go to top ]
- Posted by: sergiu truta
- Posted on: December 23 2003 02:52 EST
- in response to kingbow jb
ejbRemove() is called for session beans every time the container destroyes the bean. So you can use this method to do the stuff you typically would do in unsetEntityContext().
For entity beans ejbRemove() is only called if the user explicitly deletes the bean. I think that is the reason why the engineers at SUN invented the unsetEntityContext() for this kind of bean. -
A Question about SessionBean and EntityBean?[ Go to top ]
- Posted by: sergiu truta
- Posted on: December 23 2003 02:55 EST
- in response to sergiu truta
so if you implement a unsetSessionContext() inside the session bean it will never be called. -
A Question about SessionBean and EntityBean?[ Go to top ]
- Posted by: Manish Gupta
- Posted on: December 27 2003 06:34 EST
- in response to sergiu truta
yes, if you write unsetSessionContext() inside the session bean it will never be called because it is not a callback method for session beans.