[wildfly-dev] How to deal with resource refs when deploying JPA container managed entity managers (WFLY-2841)

Jason Greene jason.greene at redhat.com
Fri Jan 31 12:34:16 EST 2014


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.

On Jan 31, 2014, at 11:03 AM, Martin Andersson <martin.andersson at purplescout.se> wrote:

> Thanks for your input!
> 
> The alias and global naming does actually work!
> 
> Br,
> Martin Andersson
> Java EE developer at www.purplescout.se
> 
> 
> 
> On Fri, Jan 31, 2014 at 5:56 PM, Jason Greene <jason.greene at redhat.com> wrote:
> 
> On Jan 31, 2014, at 10:39 AM, Jason Greene <jason.greene at redhat.com> wrote:
> 
> >
> > On Jan 31, 2014, at 8:33 AM, Martin Andersson <martin.andersson at purplescout.se> wrote:
> >
> >> I agree. I don't think mapping a datasource in jboss-web.xml is such an exotic use case. I should just work.
> >
> > 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.
> >
> >> Also, there is no hint anywere that there is a property you can set to make it work.
> >>
> >> The proprietary jboss namespace is not an option since I want to be vendor neutral, but ear/java:app is definitely an option.
> >
> > 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.
> >
> > A more complete solution is to use a common global name, and define an alias to your deployment in our naming subsystem like so:
> >
> > <bindings>
> >   <lookup name="java:global/env/FooDS" lookup="java:jboss/datasources/ExampleDS"/>
> > </bindings>
> >
> 
> Actually don’t waste your time on this alias option. PeristenceUnitServiceHandler’s approach to names will prevent it from working.
> 
>> 
> Jason T. Greene
> WildFly Lead / JBoss EAP Platform Architect
> JBoss, a division of Red Hat
> 
> 
> 
> 
> -- 
> Hälsningar,
> Martin Andersson
> Purple Scout AB
> +46 732 05 14 01

--
Jason T. Greene
WildFly Lead / JBoss EAP Platform Architect
JBoss, a division of Red Hat




More information about the wildfly-dev mailing list