Announcement Announcement Module
Collapse
No announcement yet.
Batch update returned unexpected row count from update: 0 actual row count: 0 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch update returned unexpected row count from update: 0 actual row count: 0

    Hi,

    While calling the saveUser() method i'm getting the fallowing error.

    public void saveUser(User user)
    {
    getHibernateTemplate().saveOrUpdate(user);

    }

    org.springframework.orm.hibernate3.HibernateSystem Exception: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
    org.springframework.orm.hibernate3.SessionFactoryU tils.convertHibernateAccessException(SessionFactor yUtils.java:656)
    org.springframework.orm.hibernate3.HibernateAccess or.convertHibernateAccessException(HibernateAccess or.java:413)
    org.springframework.orm.hibernate3.HibernateTempla te.execute(HibernateTemplate.java:361)
    org.springframework.orm.hibernate3.HibernateTempla te.saveOrUpdate(HibernateTemplate.java:668)
    MyDaoHibernateImpl.saveUser(MyDaoHibernateImpl.jav a:46)
    BusinessLogic.saveuser(BusinessLogic.java:41)
    CheckAction.execute(CheckAction.java:36)
    org.springframework.web.struts.DelegatingActionPro xy.execute(DelegatingActionProxy.java:106)
    org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:449)
    org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:264)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1176)
    org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:454)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


    Can anyone let me know what is the root cause for the exception,
    I am working with HSQL data base.

  • #2
    The JDBC driver is telling Hibernate that it did not update any rows as a result of Hibernate's INSERT or UPDATE. Hibernate reasonably enough thinks that this cannot be correct. E.g. maybe the row you were trying to update has been deleted?

    Comment


    • #3
      This might be helpful: http://blogs.warwick.ac.uk/colinyate...e_and_their_1/

      Comment

      Working...
      X