-->
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.  [ 2 posts ] 
Author Message
 Post subject: Triggers with create-drop mode
PostPosted: Wed Apr 30, 2008 3:18 am 
Newbie

Joined: Wed Feb 27, 2008 10:47 am
Posts: 6
hi all,
I am using Hibernate 3 / Spring / Tomcat / Mysql


In a spring file i have :

<entry key="hibernate.hbm2ddl.auto" value="create-drop" />

it works, when i start tomcat, my database is created, when i stop tomcat my database is dropped

In my database i have triggers defined in a hbm.xml file like this:

<hibernate-mapping>
<database-object>
<definition
class="com.util.db.UtCountSceneProcedureDefinition">
</definition>
</database-object>
</hibernate-mapping>

When i start tomcat they are created, when i stop they are dropped.

But, they are created 3 times and they are dropped 3 times!


In my xml file it's like : 5.7. Auxiliary Database Objects : http://www.hibernate.org/hib_docs/refer ... pping.html

my java class extends AbstractAuxiliaryDatabaseObject.

Any idea?
Thanks a lot
Flo


Top
 Profile  
 
 Post subject: Re: Triggers with create-drop mode
PostPosted: Mon May 05, 2008 3:30 am 
Newbie

Joined: Wed Feb 27, 2008 10:47 am
Posts: 6
igloof wrote:
hi all,
I am using Hibernate 3 / Spring / Tomcat / Mysql


In a spring file i have :

<entry key="hibernate.hbm2ddl.auto" value="create-drop" />

it works, when i start tomcat, my database is created, when i stop tomcat my database is dropped

In my database i have triggers defined in a hbm.xml file like this:

<hibernate-mapping>
<database-object>
<definition
class="com.util.db.UtCountSceneProcedureDefinition">
</definition>
</database-object>
</hibernate-mapping>

When i start tomcat they are created, when i stop they are dropped.

But, they are created 3 times and they are dropped 3 times!


In my xml file it's like : 5.7. Auxiliary Database Objects : http://www.hibernate.org/hib_docs/refer ... pping.html

my java class extends AbstractAuxiliaryDatabaseObject.

Any idea?
Thanks a lot
Flo


Any ideas? :)


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

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.