1

I have an application in grails, which i can the change the parameters in the welcome page, database configuration included (server, username, ...), i externalized the db configuration from the datasource so i can change it. What i want to do, is to have the possibility to start the application without any database configured, so i can configure it after that, in the welcome page. Is this possible with grails ? i want at least load the first page (this page doesn't retrieve any information from the db).

Thanks !

Ahmed Laatabi
  • 907
  • 1
  • 8
  • 21

1 Answers1

2

I did a blog post along these lines a while back: http://burtbeckwith.com/blog/?p=312

I'm not sure if it still works with 2.0, but it shouldn't require too much tweaking. By delaying the creation of the datasource, you can configure the connection properties of the DataSource bean or in the Grails config and after that the next connection request will use the new configuration.

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
  • I have been trying to follow those examples in Grails 3.2.3. Go figure. No success at all. – Pere Nov 18 '16 at 09:40
  • 2
    I spent a while trying to update the code for Grails 3 and recent versions of GORM but there have been a lot of changes and I found multiple blocking issues and I wasn't able to get this working – Burt Beckwith Nov 20 '16 at 20:25