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).
... 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With