tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonywestonuk <to...@totspics.com>
Subject Re: Datasources....Again! Sorry....
Date Fri, 06 May 2016 18:07:25 GMT
Its just what I am used to with tomcat.   A set of global resources are
defined, and then the one that is required is 'selected' by the context.xml
choosing a global data resource.  

One of the advantages is that it was very easy to change between different
test environments.... just by change the reference in context.xml,  your app
is now pointing at a different database, without having to update the
settings at the server level tomee.xml

I think its possible using a public static String to define which id is
needed, and then have to select. not quite as clean, but at least I can
change the database looked at by the whole app in one place.

@resource(name=DATABASE_REF)
DataSource database




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Datasources-Again-Sorry-tp4678367p4678378.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message