This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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
Joined: Oct 09, 2006
I realized this was NOT what was happening and the problem was elsewhere - problem solved.