-->
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.  [ 4 posts ] 
Author Message
 Post subject: Tables recreated on each new openSession()
PostPosted: Sun Aug 31, 2003 12:22 pm 
Newbie

Joined: Sun Aug 31, 2003 12:04 pm
Posts: 8
I was just getting in to things when I noticed that every time I added data to my DB it would drop and recreate all the tables first.

I'm starting out simple, all persisted classes are created by hbm2java and SchemaExport creates the schema. I have then written a couple of simple utils that load the DB with some data from a file. The session is created and saved basically using identical code to the Cat tutorial.

Every time I run my apps though I see in the mysql log all the tables being desroyed/recreated and all of my old data has gone. Did I miss something really obvious? :-P

(I think I saw a similar post before but can't find it, sorry)

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2003 12:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
I remember a similiar post, also. I think it may have been on the old forum (available at sourceforge).

If I remember correctly, it was an issue where the user's property file was not being found and so hibernate was actually using the default property file inside the jar. The issue was that in one of the releases, the default values for schema generation in the file were set to always regernerate the schema.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2003 12:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Here's a link to that discussion:
http://sourceforge.net/forum/message.php?msg_id=2158078


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2003 3:42 pm 
Newbie

Joined: Sun Aug 31, 2003 12:04 pm
Posts: 8
Thanks Steve! I had a quick look through the thread and now everything is working how I'd expect :)

To quote the original poster...

I added the following in my Hibernate.cfg.xml
<property name="hibernate.hbm2ddl.auto">false</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.