Page 1 of 1

Tables deleted when Jetty is stopped

Posted: Tue Feb 12, 2013 1:15 pm
by TNuzzi
I was wondering what is causing the database table to be deleted when Jetty is stopped. I am using the latest Demo app.

Thanks,

Tony

Re: Tables deleted when Jetty is stopped

Posted: Tue Feb 12, 2013 1:47 pm
by lmikula
Check the settings in development.properties found in site/src/main/resources/runtime-properties/development.properties

Code: Select all

blPU.hibernate.hbm2ddl.auto=create-drop

From hibernate docu:

Code: Select all

    hibernate.hbm2ddl.auto Automatically validates or exports schema DDL to the database when the SessionFactory is created.
With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.

    e.g. validate | update | create | create-drop

So the list of possible options are:
    - validate: validate the schema, makes no changes to the database.
    - update: update the schema.
    - create: creates the schema, destroying previous data.
    - create-drop: drop the schema at the end of the session.

Re: Tables deleted when Jetty is stopped

Posted: Tue Feb 12, 2013 2:18 pm
by TNuzzi
Thanks for the info, lmikula.

Tony