File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New EJB Instance

 
Jeff Storey
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone. I have a problem where I'm trying to get a new instance of a stateful bean. The situation is that I have Bean A doing some processing that I want to cancel. Rather than trying to stop it in its tracks, I simply give the client program a new copy of that bean, call it Bean B. The client now listens to messages sent from Bean B, and is unaware that Bean A is still finishing its server side processing (at which point it will no longer be used).

I try to lookup the bean with
Object ref = jndiContext.look("MyBeanClassImpl/remote");
MyBeanClass b = (MyBeanClass) PortableRemoteObject.narrow(ref,MyBeanClass.class)

When I do an == comparison on Bean A and Bean B, it returns true and then I get errors about concurrent calls on the bean. Essentially, the users reference to the MyBeanClass object should now be pointing to B, which should be different than A. Can someone explain to me why it is not different and how I can make it be different?

Thank you,
Jeff
 
Jeff Storey
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realized this was NOT what was happening and the problem was elsewhere - problem solved.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic