Hi,
I've created an webapplication that uses Hibernate to communicate with a mysql database.
Om ny home PC ( Gentoo linux ), everything works great. However, when I try to install it on a windows PC, a few problems emerge...
Hibernate doesn't seem to commit some data to te database. Altough I do:
session.flush();
session.close();
factory.closeSession();
When i add data.
When I then try to readd the data I just tried to add, but didn't commit, I get an exception in my logs saying: "Object with same unique constraint already exist in session...". So it is still in the session. With some luck, when I try to add something totaly different, it suddenly does commit the previously entered data.
Is there a way to make sure the session gets commited every time data is added?
I'm sorry for not being able to post entire Error stack, but as i sead, it doesn't occur on my own PC. If i need to give more info, just say so, i'll keep a close watch to the topic...
Some help would be greatly appreciated, my deadline is comming really close...
Thx !
JD
Hibernate.cfg.xml:
Code:
<?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">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="myeclipse.connection.profile">hibernate2</property>
<property name="connection.url">jdbc:mysql://192.168.2.19/project</property>
<property name="connection.username">xxxx</property>
<property name="connection.password">xxxx</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property><mapping resource="rapport/library/Gebruiker.hbm.xml" /><mapping resource="rapport/library/Student.hbm.xml" /><mapping resource="rapport/library/Vak.hbm.xml" /><mapping resource="rapport/library/Type.hbm.xml" /><mapping resource="rapport/library/VakOnderdeel.hbm.xml" /><mapping resource="rapport/library/Punten.hbm.xml" /><mapping resource="rapport/library/Details.hbm.xml" /><mapping resource="rapport/library/Volgt.hbm.xml" /><mapping resource="rapport/library/Doceert.hbm.xml"></mapping><mapping resource="rapport/library/Admins.hbm.xml"></mapping><mapping resource="rapport/library/Klasgroepen.hbm.xml"></mapping>
</session-factory>
</hibernate-configuration>
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: