• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new to EJB needs help

 
Rajiv Ranjan
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please answer this question with a little explanation :
1. InitialContext ic = new InitialContext();
2. Object o = ic.lookup("testBean/TestBean");
3. TestHome th = (TestHome)javax.rmi.PortableRemoteObject.narrow(o,TestHome.class);
4. String result = myTest.userMethod();
5. myTest.remove();
6. // Bean state?
Assume the application server has just been started. At the commented-marker in the client code above (Line 6), in which state is this desired bean?

a)Method-ready-tx
b)Method-ready
c)Passivated
d) It does not exist.
e) Active
Thanks
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the answer would be d)Does not exist. This is from the 2.0 spec:
When the client calls remove on the home or remote interface to remove the session object,
the container issues ejbRemove() on the bean instance. This ends the life of the session
bean instance and the associated session object.
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
d
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic