-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: import.sql imported more than once
PostPosted: Thu Aug 13, 2009 7:01 am 
Newbie

Joined: Fri Sep 15, 2006 2:09 am
Posts: 11
I'm using import.sql successfully in an ejb.jar together with JPA. In my persistence.xml I've configured autoddl to 'create'.
So when the table doesn't exist, it will be created and data from import.sql will be imported without any problems.
If the table already exists, nothing happens - as expected.

Now this ejb.jar is bundled with other ejb.jars in an EAR. All other ejb.jars use also JPA with autoddl set to create but without an import.sql itself.

Now it happens that on deployment of the EAR, _everytime_ the import.sql is executed n times (n=for each ejb.jar) which leads to errors because IDs already exist in db from the first execution of the import.sql.

Two things I can't explain:

a) why is the import.sql executed although all tables exist?
b) why is the import.sql executed n times, although it exists only on the classpath of the first ejb.jar?

Adding an additional empty import.sql of one of the other ejb.jars leads to no import and no errors messages.

It seems that the autoddl has a problem with classloading?!

I'm using JBoss 5.1.0.

Any hints?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.