-
Nov 2nd, 2009, 10:12 AM
#1
Hibernate Newbie: Current data getting deleted
Hi Folks,
Complete hibernate newbie here. I've set up a small web app using hibernate, spring etc. This is all up and running and I can't see any issues apart from one (there always is eh)
When I first start the application (Tomcat 5.5) the current data that I have on the database table gets deleted ?? I don't want this happening but I can't find anything that tells me this is correct behavior or how to stop it ?
Any ideas ?
Thanks
- Garreth
-
Nov 2nd, 2009, 11:58 AM
#2
Change your hibernate configuration. My guess is that you have enabled that the tables need to be (re)created on application startup.
-
Nov 2nd, 2009, 12:14 PM
#3
Yep that was it thanks very much...
<prop key="hibernate.hbm2ddl.auto">create</prop>
changed to
<prop key="hibernate.hbm2ddl.auto">update</prop>
Job done
Thanks
- Garreth
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules