[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-663) Local interface should be preferred over remote when injected via @EJB
Fredrik Persson (JIRA)
jira-events at jboss.com
Thu Oct 19 05:44:41 EDT 2006
[ http://jira.jboss.com/jira/browse/EJBTHREE-663?page=comments#action_12345495 ]
Fredrik Persson commented on EJBTHREE-663:
------------------------------------------
Hi
I don't agree. Sure, this is a problem, but the solution is not try to optimize local over remote.
Such as solution would create a undeterministic situation where sometimes calls get done local (with call-by-value and, for example, entity classes still attached) and sometimes calls get done remote (with call-by-reference, for example, entity classes detached). It would create hard-to-maintain, hard-to-debug and strange-error-behavior code.
The solution is to either:
* Deny/Warn deploy of code where the same java interface is used for both local and remote EJB3 interface.
* Deny/Warn deploy of code that uses plain injection (without arguments) on a java interface that have multiple EJB3 interfaces.
The design pattern we applied after discovering this behavior in JBoss is to Never use the same java interface for local and remote EJB3 interface.
Regards
F Persson
> Local interface should be preferred over remote when injected via @EJB
> ----------------------------------------------------------------------
>
> Key: EJBTHREE-663
> URL: http://jira.jboss.com/jira/browse/EJBTHREE-663
> Project: EJB 3.0
> Issue Type: Feature Request
> Affects Versions: EJB 3.0 RC8 - FD
> Reporter: Petr Matejka
>
> Having a session-bean with interface annotated with both @Local and @Remote annotations and injected into another session-bean via @EJB, the injected proxy should be local proxy and not remote proxy.
> I think changing ProxyFactoryHelper.getJNDIName should do the thing.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list