Grails not updating database

I changed the relevant part of Data Source.groovy to the following: Every time I restart the server, all the data has disappeared. I have tried it both with and without sample data in Boot Strap.groovy (if that makes any difference).

The database migration plugin allows you to keep track of the structural changes made to your database.

You can change your url to point to a file or relational database, though, if you want to persist w/out using Boot Strap.groovy. url = "jdbc:h2:db/dev Db;auto_server=true" Here's an example using my Sql (assuming you have a jdbc driver for mysql available): url = "jdbc:mysql://localhost:8080/foo?

autoreconnect=true" An example w/ file: url = "jdbc:hsqldb:file:prod Db;shutdown=true" Hope this helps.

By default GORM classes are configured for optimistic locking, which is a feature of Hibernate that involves storing an incrementing version in the table.

This value is only updated in the database when the Hibernate session is flushed.

Search for grails not updating database:

grails not updating database-22grails not updating database-53

They hold state about business processes and hopefully also implement behavior.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “grails not updating database”