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: The Hibernate erase my registers
PostPosted: Mon Jun 05, 2006 9:00 am 
Beginner
Beginner

Joined: Sun May 07, 2006 4:41 pm
Posts: 20
Location: São Paulo - BRAZIL
Hy guys,
I'm using Hibernate 3 + TOMCAT 5.5 and when I start my aplication, the Hibernate erase my registers in the table. In annex it follows the hibernate.cfg.xml.

Thank's.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="hibernate.connection.password">paulo123</property>
<property name="hibernate.connection.url">jdbc:microsoft:sqlserver://10.173.100.23;DatabaseName=HIBERNATE;SelectMethod=cursor</property>
<property name="hibernate.connection.username">paulonep</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>

<!-- Use the C3P0 connection pool. -->
<property name="c3p0.min_size">3</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">1800</property>

<!-- Disable second-level cache. -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property>
<property name="max_fetch_depth">3</property>

<!-- Print SQL to stdout. -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>

<!-- Drop and then re-create schema on SessionFactory build, for testing. -->
<property name="hbm2ddl.auto">create</property>

<!-- Bind the getCurrentSession() method to the thread. -->
<property name="current_session_context_class">thread</property>

<!-- Hibernate XML mapping files -->

<mapping resource="br/com/shc/database/pessoa/Pessoa.hbm.xml"/>

</session-factory>
</hibernate-configuration>

_________________
Paulo Nepomuceno
Java Developer


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 05, 2006 9:15 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
Comment or remove this <property name="hbm2ddl.auto">create</property> if you don't need it.


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.