My objects are stored in the database correctly, however, when I restart the application, all tables in my database (mysql) are always cleared.
During runtime I can see that the database if filled correctly.
When I quit the application, the database still contains all objects.
After I restart however, I see that all tables are cleared from the database. At that moment the application has not done anything with hibernate. Somehow, when the sessionFactory is created, it first clears the tables....
I use the following settings for the sessionFactory (Spring):
Code:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="hibernateProperties">
<props>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<prop key="hibernate.connection.pool_size">1</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.connection.autocommit">true</prop>
What am I doing wrong?
What do I have to do such that hibernate will not clear the tables when my application is started?