"bill.burke(a)jboss.com" wrote : You can break the circular dependency by adding
the @IgnoreDependency annotation to the injected @EJB
|
|
| | @Stateless
| | public class MyBean implements ... {
| |
| | @EJB
| | @IgnoreDependency
| | private AnotherEJB another;
| |
| | }
| |
| |
|
| Or use the XML version.
|
|
| | <jboss>
| | <enterprise-beans>
| | <session>
| | <ejb-name>Session1Bean</ejb-name>
| | <ejb-ref>
| | <ejb-ref-name>session2</ejb-ref-name>
| | <ignore-dependency/>
| | </ejb-ref>
| | </session>
| | </enterprise-beans>
| | </jboss>
| |
| |
|
The EJB3 spec doesn't seem to have anything to say about this. I have a few circular
dependencies in my code (for which the JBoss solution of @IgnoreDependency works really
well) but I am wondering should they be refactored out, or is circular injection a
conceptually valid thing to do?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089093#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...