javaspringejbejb-3.1ejb-2.x

Can we avoid static data in ejb proxy object?


Can we avoid the static data ref. in the EJB proxy object that we get at the client using rmi call.

I am using the spring Di for getting ejb object and can see lots of Static ref. in my object.

Also i am calling from local only but doing a remote call.

I have checked for the same on the net but not found much. can anyone advice here..

Thanks in advance !!! :)


Solution

  • Short answer: No.

    Long answer: EJB proxies are container-generated remote proxies, you should interact with their interfaces, not their implementations. The actual implementation is vendor-specific, server-generated code which deals with all the complexity of EJB services. It should only be of interest if you want to know how the container itself works.

    On using remote interfaces: It's fine to use remote connections to EJBs which are in fact hosted locally. This makes your application more extensible, as it doesn't make local hosting a dependency. It does add an overhead to calls, so there is a performance cost to this, but it's not that large.