Reputation: 9
Is it possible to send dynamic values from Controller/Domain classes to DataSource.groovy?
Ex: default_schema = ${someConfig.default_schema}
Upvotes: 1
Views: 264
Reputation: 3076
Not possible. DataSource is loaded when the app starts up. There is no way to change this configuration in the run-time.
If your objective is to externalize Datasource configuration, you can use JNDI like:
dataSource {
jndiName = "java:comp/env/myDataSource"
}
and define the data source in web-app/META-INF/context.xml.
Upvotes: 1