Moving values of Config.groovy to Database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Moving values of Config.groovy to Database

clr meno
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

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/5650ba04-ffaa-41cd-a8b5-36c9cdc9ffcb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Moving values of Config.groovy to Database

Jeff Scott Brown-4
On 30 Aug 2017, at 7:00, clr meno wrote:

> 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.
>

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/

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/5B5C5015-6975-49C1-9BD8-BA8D47B87375%40objectcomputing.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Moving values of Config.groovy to Database

clr meno
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

On Wednesday, August 30, 2017 at 9:52:04 AM UTC-4, Jeff Scott Brown wrote:
On 30 Aug 2017, at 7:00, clr meno wrote:

> 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.
>

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
<a href="http://www.autismspeaks.org/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.autismspeaks.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLOilSQBYB1lzLN6Ms6K6DtQY5DQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.autismspeaks.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLOilSQBYB1lzLN6Ms6K6DtQY5DQ&#39;;return true;">http://www.autismspeaks.org/

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/0bfccaa3-156f-44d5-b965-7d6ed8e5c2d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.