Wednesday, June 26, 2013

Grails : why datas aren't persit ?

By default, under Grails, you are in developpement mode.
So each time, you run your application with grails run-app, you will loose your data.

For example, if you use scaffold, all data you save will be loose after restart :

class RegistrationController {

    def scaffold = true
}
First time, it's a little bit frustating ...
If you want to see datas each time you run, you have to change databases configuration.
There is an another way to see datas :
 grails prod run-app
 Then persit datas and if you start again, you will see you datas.

No comments:

Post a Comment