But what happend when in a session I invoke a method of a entity that return a collecion of bean? do I have to use portableremoteObject() or a simple cast?
And what happend whith the findByPrimeryKey that return the component interface remote. I never use portableremoteObject, do I should???
Thanks!! a lot
posted 11 years ago
Narrowing is only for the Initial EJBHome Stub....that too only in case of Remote Calls.... since u r doing a IIOP call which might result in u getting Objects of some other Language type...so u need to make sure that u get the right object from yr IIOP call.
After u get the EJBHome stub... u r all set... then u dont need a narrow call ever... since u already know what Object u r working on....of course u can get a collection from from yr EJBHome object when u fetch more than ONE primary key.... but the whole point is that u r aware that these calls are on the EJBHome STUB ...
But in case of the IIOP lookup u are not sure footed as to what Object type u might be returned ... so PortableRemoteObject.narrow() makes it sure u get the right Object.
Hope this helps...
Best Regards,<br />Rajnish Bhasin.<br />SCJP<br />SCWCD<br />SCBCD