Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
19. Aug 2008, 14:17 CET | Link

Every time I restart the application, everything in my database is erased. I got these errors from jboss server. do you have any idea about this problem

15:09:13,092 INFO [SchemaExport] Running hbm2ddl schema export
15:09:13,092 INFO [SchemaExport] exporting generated schema to database
15:09:22,701 INFO [Ejb3Configuration] [PersistenceUnit: dfs] no META-INF/orm.xml found

3 Replies:
19. Aug 2008, 15:16 CET | Link
Per Hibernate docs:

hibernate.hbm2ddl.auto Automatically validate or export 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.

eg. validate | update | create | create-drop


so in your persistence.xml you want to comment out:

<property name="hibernate.hbm2ddl.auto" value="create-drop"/>

or set it to create to generate your ddl for the first time then comment it out. Of course, in production you never want a create-drop policy, but during development it is the best idea to allow quick changes to your Entities/code.


19. Aug 2008, 15:45 CET | Link
One addition to what I was previously saying, in development, you'll typically combine <property name="hibernate.hbm2ddl.auto" value="create-drop"/> with import statements in your import-dev.sql which will create-drop your ddl every time you redeploy and repopulate the database with test data for you to click through and manually test out new code.
19. Aug 2008, 16:27 CET | Link

it worked. thank you