Parameterized config of datasources in standalone.xml

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Parameterized config of datasources in standalone.xml

Richard Kilcoyne
I'm working on parameterizing my datasources in standalone.xml. Specifying system properties as ${DB_URL} for connection url, username, password works great using properties passed to jboss via -Dapp.properties, but after the first run, the values are permanently substituted in this file. If my external property file is changed, standalone.xml no longer picks up the change. To re-substitute, I have to get the initial version from the standalone_xml_history dir and overwrite the current version.

Is there a better we to handle external configuration of datasources and if not, is there a better way to reset the standalone.xml config?

Thanks,
Rick
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Parameterized config of datasources in standalone.xml

Brian Stansberry
Configuration attributes that support expressions (aka system property
substitution) should *not* be writing the resolved values back to the
xml file.If you are seeing this with a build of the current AS 7 master
branch, it's a bug, and I'd very much appreciate your filing an issue in
JIRA.

Thanks!

On 2/6/12 8:26 PM, Richard Kilcoyne wrote:

> I'm working on parameterizing my datasources in standalone.xml. Specifying system properties as ${DB_URL} for connection url, username, password works great using properties passed to jboss via -Dapp.properties, but after the first run, the values are permanently substituted in this file. If my external property file is changed, standalone.xml no longer picks up the change. To re-substitute, I have to get the initial version from the standalone_xml_history dir and overwrite the current version.
>
> Is there a better we to handle external configuration of datasources and if not, is there a better way to reset the standalone.xml config?
>
> Thanks,
> Rick
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Parameterized config of datasources in standalone.xml

Stuart Douglas
In reply to this post by Richard Kilcoyne
I can't reproduce this on upstream. Which AS7 version are you using, and if it is a recent version which properties do you see this happening with?

Stuart



On 07/02/2012, at 1:26 PM, Richard Kilcoyne wrote:

> I'm working on parameterizing my datasources in standalone.xml. Specifying system properties as ${DB_URL} for connection url, username, password works great using properties passed to jboss via -Dapp.properties, but after the first run, the values are permanently substituted in this file. If my external property file is changed, standalone.xml no longer picks up the change. To re-substitute, I have to get the initial version from the standalone_xml_history dir and overwrite the current version.
>
> Is there a better we to handle external configuration of datasources and if not, is there a better way to reset the standalone.xml config?
>
> Thanks,
> Rick
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Parameterized config of datasources in standalone.xml

Richard Kilcoyne
Using 7.0.2. Here's one of my datasources:

<datasource jndi-name="java:jboss/datasources/tertiary" pool-name="tertiary_pool" jta="true" use-java-context="true" use-ccm="true">
    <connection-url>${datasource.tertiary.url}</connection-url>
    <driver>${datasource.tertiary.driver}</driver>
    <security>
        <user-name>${datasource.tertiary.uid}</user-name>
        <password>${datasource.tertiary.pwd}</password>
    </security>
    <validation>
        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
    </validation>
</datasource>

After the first startup using this configuration, the datasource (and all ${config_vals}) are resolved and re-written to standalone.xml never to be seen again except for in the xml config history as the initial version.

Rick

On Feb 6, 2012, at 9:42 PM, Stuart Douglas wrote:

> I can't reproduce this on upstream. Which AS7 version are you using, and if it is a recent version which properties do you see this happening with?
>
> Stuart
>
>
>
> On 07/02/2012, at 1:26 PM, Richard Kilcoyne wrote:
>
>> I'm working on parameterizing my datasources in standalone.xml. Specifying system properties as ${DB_URL} for connection url, username, password works great using properties passed to jboss via -Dapp.properties, but after the first run, the values are permanently substituted in this file. If my external property file is changed, standalone.xml no longer picks up the change. To re-substitute, I have to get the initial version from the standalone_xml_history dir and overwrite the current version.
>>
>> Is there a better we to handle external configuration of datasources and if not, is there a better way to reset the standalone.xml config?
>>
>> Thanks,
>> Rick
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Parameterized config of datasources in standalone.xml

Jesper Pedersen
On 02/08/2012 04:24 AM, Richard Kilcoyne wrote:
> Using 7.0.2. Here's one of my datasources:
>

Use latest AS7 snapshot - or wait for AS 7.1.0.Final is out.
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Parameterized config of datasources in standalone.xml

Richard Kilcoyne
Thanks! That's the plan -- AS 7.1.0.Final

On Feb 8, 2012, at 8:40 AM, Jesper Pedersen wrote:

> On 02/08/2012 04:24 AM, Richard Kilcoyne wrote:
>> Using 7.0.2. Here's one of my datasources:
>>
>
> Use latest AS7 snapshot - or wait for AS 7.1.0.Final is out.

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev