• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange error when using Hibernate

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm really new to Hibernate. I use both Spring and Hibernate. I am almost finished with my test application. Everything works fine and I see with MySQL Query Browser that records will be inserted into the database from my Web browser. I have also made a web page that reads records from my database and I see all my insterted records in that web page.

Now, to the strange part!

After a while - maybe 5-10 minutes all my inserted data will disappear from the database. Why? Can someone help med describe that? Is autocommit turned off? Some default value that must be changed?

This is my mapping file;

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="businessLayer.Project" table="project">
<id name="id" column="id" type="java.lang.Integer">
<generator class="native"/>
</id>
<property name="ProjectId" type="java.lang.Integer"/>
<property name="ProjectNumber" type="java.lang.Integer"/>
<property name="ProjectName" type="java.lang.String"/>
</class>

</hibernate-mapping>
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do you have the following set in your hibernate.cfg.xml




If yes, comment out this setting and see if it works
reply
    Bookmark Topic Watch Topic
  • New Topic