[jboss-user] [JBoss Seam] - import.sql executed twice (I know why but...)
nmartignole
do-not-reply at jboss.com
Wed Aug 8 10:31:35 EDT 2007
Hi guys
As you know, you can define an SQL file "import.sql" that gets imported by Hibernate at each application deploy. I add an issue this morning: all my sample entries were imported twice at each deploy...
I found that the reason was due to a duplicate definition of property hibernate.hbm2ddl.auto in both my hibernate.cfg.xml and persistence.xml file.
If you set the value to create-drop in both files, the import.sql file is imported twice. To make it work properly I updated the value to "update" in the hibernate.cfg.xml.
my question is :
- is this a bug to let the user in Seam do this ? or couldn't we drop a little WARN message just in case of ?
I also found that persistence.xml is the first one that gets called. hibernate.cfg.xml for my jBPM stuffs is called after all the jbpm init stuffs.
So maybe the order could be also important if I want to create defaults users in the jbpm part...
I just want a feed back and your opinion on this.
Thanks
Nicolas
--------------------------------------------------------
>From hibernate doc:
anonymous wrote :
| 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
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072042#4072042
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072042
More information about the jboss-user
mailing list