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>&lt;?xml version='1.0' encoding='utf-8'?&gt;
<br>&lt;!DOCTYPE hibernate-configuration PUBLIC<br>&quot;-//Hibernate/Hibernate Configuration DTD//EN&quot;<br>&quot;<a href="http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
</a>&quot;&gt;<br><br>&lt;hibernate-configuration&gt;<br>&nbsp;&nbsp;&nbsp; &lt;session-factory&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;hibernate.connection.driver_class&quot;&gt;com.mysql.jdbc.Driver&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;
hibernate.connection.url&quot;&gt;jdbc:mysql://localhost/test&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;hibernate.connection.username&quot;&gt;root&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;hibernate.connection.password
&quot;&gt;&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;hibernate.connection.pool_size&quot;&gt;10&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;show_sql&quot;&gt;true&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;dialect&quot;&gt;
org.hibernate.dialect.MySQLDialect&lt;/property&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- Mapping files --&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;mapping resource=&quot;contact.hbm.xml&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/session-factory&gt;<br>&lt;/hibernate-configuration&gt;<br>
<br>my contact.hbm.xml looks like<br><br>&lt;?xml version=&quot;1.0&quot;?&gt;<br>&lt;!DOCTYPE hibernate-mapping PUBLIC <br>&nbsp;&nbsp;&nbsp; &quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;<br>&nbsp;&nbsp;&nbsp; &quot;<a href="http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd</a>&quot;&gt;<br>&lt;hibernate-mapping&gt;<br>&nbsp; &lt;class name=&quot;com.test.dbo.contact&quot; table=&quot;contacts&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;id name=&quot;id&quot; type=&quot;long&quot; column=&quot;id&quot; &gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;generator class=&quot;increment&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp; &lt;/id&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp; &lt;property name=&quot;email&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;column name=&quot;email&quot; /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp; &lt;/property&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp; &lt;property name=&quot;modified_date&quot;&gt;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;column name=&quot;modified_date&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp; &lt;/property&gt;<br>&nbsp;&nbsp; &lt;/class&gt;<br>&lt;/hibernate-mapping&gt;<br><br>The Java Code looks like the following<br>SessionFactory factory = null;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Configuration cfg = new Configuration();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;factory = cfg.configure().buildSessionFactory();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Session&nbsp; session =&nbsp; factory.openSession();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;notification_email ne = createNotificationEmail();
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;session.save(ne);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;session.flush();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;session.close();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;catch(Exception e)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{ <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println(&quot;&quot;+e);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
e.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<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>