Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails not preserving my DB data

Tags:

grails

I am building a small Grails application, and I am trying to make the data persist between server restarts in the development environment.

I changed the relevant part of DataSource.groovy to the following:

development {
    dataSource {
        dbCreate = "update" // one of 'create', 'create-drop','update'
        url = "jdbc:hsqldb:mem:devDB"
    }
}

Every time I restart the server, all the data has disappeared. Am I missing another configuration?

I have tried it both with and without sample data in BootStrap.groovy (if that makes any difference).

like image 556
sim Avatar asked Oct 10 '11 12:10

sim


1 Answers

... try dropping the 'mem' part of your url string: jdbc:hsqldb:devDB Right now you're running the db in memory mode, hence the loss of data. Running the db in embedded mode should do what you need.

like image 143
vector Avatar answered Sep 27 '22 22:09

vector