|
From: Les A. H. <le...@ha...> - 2004-04-20 17:36:23
|
Hiya folks, I was digging around in the source code and noticed that the SimpleRemoteSlsbInvokerInterceptor "create"s a new EJB handle per method invocation (via the newSessionBeanInstance() method in the parent AbstractRemoteSlsbInvoker). Aren't there performance implications when creating a new remote handle _per_ method invocation? It seems to me like the performance overhead (network calls, garbage collection, etc) could be substantial if you reference many ejb's in a system. Is there a fundamental reason why the stub returned upon calling create() is not cached for further use? For my own personal use, I subclassed the SimpleRemoteStatelessSessionProxyFactorybean and created a CachingRemoteSlsbProxyFactoryBean. This class caches the returned stub upon the first call to newSessionBeanInstance() and then uses that stub for further method invocations. Is there anything wrong with that approach? I just want to make sure what I'm doing doesn't violate any design principles... Thanks, Les |