<div dir="ltr">Thanks for your input!<div><br></div>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><div><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 5:56 PM, Jason Greene <span dir="ltr"><<a href="mailto:jason.greene@redhat.com" target="_blank">jason.greene@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><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>
><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>
>> I agree. I don't think mapping a datasource in jboss-web.xml is such an exotic use case. I should just work.<br>
><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>
>> 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>
><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>
<br>
</div></div>Actually don’t waste your time on this alias option. PeristenceUnitServiceHandler’s approach to names will prevent it from working.<br>
<div class="HOEnZb"><div class="h5"><br>
—<br>
<br>
Jason T. Greene<br>
WildFly Lead / JBoss EAP Platform Architect<br>
JBoss, a division of Red Hat<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Hälsningar,<div>Martin Andersson</div><div>Purple Scout AB</div><div>+46 732 05 14 01</div></div>
</div>