Moving values of Config.groovy to Database

26 views
Skip to first unread message

clr meno

unread,
Aug 30, 2017, 8:00:03 AM8/30/17
to Grails Dev Discuss
Hi

I have a requirement to move the configurations in Config.groovy to a Database table so that the values can be changed without deployment. For Example 

environments{
    development{
             project.log.path=/application/logs
             directory.file.dowload = /application/dev/files

Can such records be moved to Database.

Thanks

Jeff Scott Brown

unread,
Aug 30, 2017, 9:52:04 AM8/30/17
to Grails Dev Discuss
Yes. You can persist and retrieve almost whatever you like to and from
the database. Depending on what you are doing with those values, that
may or may not be a simple thing.

Some things obviously can’t be moved to the database. The Database
URL, for example. ;)




JSB

--
Jeff Scott Brown
OCI Grails Practice Lead
Principal Software Engineer

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

clr meno

unread,
Aug 30, 2017, 5:10:17 PM8/30/17
to Grails Dev Discuss
Thanks Jeff. 
I want to move the config values like log path and time delay for quartz jobs etc which are now referred in the service code using Holders.config.***** or grailsApplication.config.****

1) If I create a DB table to hold these config values then should I continue to refer to these values using Holders.config.***** or grailsApplication.config.****

2) Should the Database table to hold these values be in a certain structure? Should I be defining the columns in a certain way

3) When there is any further changes to the config values that are moved to the database is a JVM restart required for the values to be applied?

4) What is the sequence of events during Grails application start up. When does the loading of Config values happen

Thanks
Reply all
Reply to author
Forward
0 new messages