user5258820
user5258820

Reputation:

broadleaf database tables does not persist after application shutdown

I have been able to run the DemoSite project after changing the in-memory HSQL database to MySql following the instructions given in the broadleaf commerce getting started instructions for changing databases .

Now when I run the Demosite application I find 183 tables get created and populated with data , but this is in existence only during the running of the application . Once the application is shut down only 4 tables remain in the database .

I am using broadleaf demosite version 4.0.0 and MySql Database . The 4 tables which remain after application shut down are named as follows : -

blc_bank_account_payment

blc_credit_card_payment

blc_gift_card_payment

blc_static_asset_strg

I have changed the relevant properties files "hbmddl2.auto" entry value to "update" so that the database tables don't get created and erased for every new run of the application but still have not been able to get rid of this issue .

I have searched a lot also posted to the relevant forums but no answer . SOF is my last resort . Please help .

Upvotes: 1

Views: 294

Answers (1)

K. Siva Prasad Reddy
K. Siva Prasad Reddy

Reputation: 12405

When you first run DemoSite you might have blPU.hibernate.hbm2ddl.auto=create-drop in your site/src/main/resources/runtime-properties/development.properties file in order to generate database tables.

How you are running the Site/Admin? From ant tomcat target from IDE or deploying war in tomcat outside of IDE.

I hope you have changed blPU.hibernate.hbm2ddl.auto property value to update.

Now if you are running ant tomcat from IDE, after changing the above property first you need to maven install core/site/admin modules before running site/admin.

If you are running from IntellijIDEA when you stop the application it will drop the tables if you have blPU.hibernate.hbm2ddl.auto=create-drop, where as Eclipse will immediately terminates the process without running the drop phase.

The best thing to do is when you start the application first time , after database tables are created and sample data is populated then take backup of the schema. Then change blPU.hibernate.hbm2ddl.auto to update, run maven install. Now start the application.

Hope it helps.

Upvotes: 1

Related Questions