Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getHibernateTemplate().saveOrUpdate() not saving the value in database.

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i call getHibernateTemplate().saveOrUpdate(transientInstance); but the value is not storing in the database.
and
below is my application.context .xml file




Please tell me.
 
Peter Mularien
Author
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hard to say without seeing how you've mapped the Hibernate object, but typically this occurs if you haven't set the version property correctly (or incorrectly indicated to hibernate what the version of an unsaved entity is).
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now its saving the data in the database.
i set this property true in hibernate config.xml;

<property name="connection.autocommit">true</property>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic