Page 1 of 1

All tables are not persisted in MySql database

Posted: Wed Sep 09, 2015 7:14 am
by incre2012
I have successfully run the DemoSite and admin projects . I have also changed the database from HSQL to MySql .

The thing I notice now is that when the application runs the 183 tables are created and populated with the required data .
But when the application is shut down all but 4 tables in the database remain but with no data in them .

What am I doing wrong . Please help .

Re: All tables are not persisted in MySql database

Posted: Tue Sep 15, 2015 8:29 am
by phillipuniverse
This is because development.properties in site has this:

Code: Select all

blPU.hibernate.hbm2ddl.auto=create-drop


Which drops all tables when the site is shut down. You can change this to just "create" to only create the tables and not drop them on shutdown.

However, if you start up again all data will be wiped and recreated, so you can start up once with "create", shut down, and then change it to "update" which won't wipe any data.