-->
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: Database persistence ends with application
PostPosted: Mon Mar 26, 2007 6:33 pm 
Newbie

Joined: Wed Mar 21, 2007 1:12 pm
Posts: 19
Hi all,

I have noticed that if I close the factory at the end of the application the created tables are removed from the database. I f I comment the factory close line:
Code:
//entitymanagerfactory.close()

the table persists in the database.

The behavior I want is the second: tables are not removed, I will remove them manually if needed.

Is it correct to not close the factory? How should this be done?

Thanks in advance,
Ruya


Top
 Profile  
 
 Post subject: Sorry
PostPosted: Mon Mar 26, 2007 6:35 pm 
Newbie

Joined: Wed Mar 21, 2007 1:12 pm
Posts: 19
I am sorry I posted and the remembered that in the persistence.xml there was a line:

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

to

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


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.