<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">It works when the MSC binder service�s ManagedReferenceFactory has the datasource, but it won�t work for external contexts (jndi federation) or link refs (which we don�t officially support). We should fix that by replacing the bind service dependency, with an injection using a LookupInjectionSource.<div><br></div><div>�E<br><div><br><div><div>On 31 Jan 2014, at 17:34, Jason Greene <<a href="mailto:jason.greene@redhat.com">jason.greene@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Ah yes it does use ManagedReferenceFactory so is reliable, I just misinterpreted the earlier conversation about there being a hard dep on the data source.<br><br>On Jan 31, 2014, at 11:03 AM, Martin Andersson <<a href="mailto:martin.andersson@purplescout.se">martin.andersson@purplescout.se</a>> wrote:<br><br><blockquote type="cite">Thanks for your input!<br><br>The alias and global naming does actually work!<br><br>Br,<br>Martin Andersson<br>Java EE developer at <a href="http://www.purplescout.se">www.purplescout.se</a><br><br><br><br>On Fri, Jan 31, 2014 at 5:56 PM, Jason Greene <<a href="mailto:jason.greene@redhat.com">jason.greene@redhat.com</a>> wrote:<br><br>On Jan 31, 2014, at 10:39 AM, Jason Greene <<a href="mailto:jason.greene@redhat.com">jason.greene@redhat.com</a>> wrote:<br><br><blockquote type="cite"><br>On Jan 31, 2014, at 8:33 AM, Martin Andersson <<a href="mailto:martin.andersson@purplescout.se">martin.andersson@purplescout.se</a>> wrote:<br><br><blockquote type="cite">I agree. I don't think mapping a datasource in jboss-web.xml is such an exotic use case. I should just work.<br></blockquote><br>It�s not, it�s actually implied by the standard, as you can define them in web.xml as well. It�s a lifecycle problem we need to solve.<br><br><blockquote type="cite">Also, there is no hint anywere that there is a property you can set to make it work.<br><br>The proprietary jboss namespace is not an option since I want to be vendor neutral, but ear/java:app is definitely an option.<br></blockquote><br>Another solution specific to EE7 is you can leave the jta-data-source undefined in persistence.xml which will use the platforms default data source. We allow you to point that anywhere. However, that limits you to one, so not really a complete solution.<br><br>A more complete solution is to use a common global name, and define an alias to your deployment in our naming subsystem like so:<br><br><bindings><br> <lookup name="java:global/env/FooDS" lookup="java:jboss/datasources/ExampleDS"/><br></bindings><br><br></blockquote><br>Actually don�t waste your time on this alias option. PeristenceUnitServiceHandler�s approach to names will prevent it from working.<br><br>�<br><br>Jason T. Greene<br>WildFly Lead / JBoss EAP Platform Architect<br>JBoss, a division of Red Hat<br><br><br><br><br>--<span class="Apple-converted-space"> </span><br>H�lsningar,<br>Martin Andersson<br>Purple Scout AB<br>+46 732 05 14 01<br></blockquote><br>--<br>Jason T. Greene<br>WildFly Lead / JBoss EAP Platform Architect<br>JBoss, a division of Red Hat<br><br><br>_______________________________________________<br>wildfly-dev mailing list<br><a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></div></blockquote></div><br></div></div></body></html>