Hi,<br>I have just started working on hibernate. I was trying to start with some sample applications.<br>I am facing this problem when I am trying to insert data. It does not throw any error but does not do any insert.<br>
I can easily fetch information using the same mapping.<br><br>Can someone help me with this.<br>I am using MYSQL5 with hibernate 3<br><br>My hibernate-cfg.xml loooks like following<br><?xml version='1.0' encoding='utf-8'?>
<br><!DOCTYPE hibernate-configuration PUBLIC<br>"-//Hibernate/Hibernate Configuration DTD//EN"<br>"<a href="http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
</a>"><br><br><hibernate-configuration><br> <session-factory><br> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property><br> <property name="
hibernate.connection.url">jdbc:mysql://localhost/test</property><br> <property name="hibernate.connection.username">root</property><br> <property name="hibernate.connection.password
"></property><br> <property name="hibernate.connection.pool_size">10</property><br> <property name="show_sql">true</property><br> <property name="dialect">
org.hibernate.dialect.MySQLDialect</property><br> <!-- Mapping files --><br> <mapping resource="contact.hbm.xml"/><br> </session-factory><br></hibernate-configuration><br>
<br>my contact.hbm.xml looks like<br><br><?xml version="1.0"?><br><!DOCTYPE hibernate-mapping PUBLIC <br> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"<br> "<a href="http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd</a>"><br><hibernate-mapping><br> <class name="com.test.dbo.contact" table="contacts"><br> <id name="id" type="long" column="id" >
<br> <generator class="increment"/><br> </id><br> <property name="email"><br> <column name="email" /><br> </property><br> <property name="modified_date">
<br> <column name="modified_date"/><br> </property><br> </class><br></hibernate-mapping><br><br>The Java Code looks like the following<br>SessionFactory factory = null;<br> try
<br> {<br> Configuration cfg = new Configuration();<br> factory = cfg.configure().buildSessionFactory();<br> Session session = factory.openSession();<br> notification_email ne = createNotificationEmail();
<br> session.save(ne);<br> session.flush();<br> session.close();<br> }<br> catch(Exception e)<br> { <br> System.out.println(""+e);<br>
e.printStackTrace();<br> }<br><br>I will greatly appreciate if someone can provide me an answer. Really struggling. thanks<br clear="all"><br>-- <br>Dinesh Chaturvedi<br><br>