org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

前端 未结 14 1357
不思量自难忘°
不思量自难忘° 2021-01-01 10:56

I am using struts and hibernate. I have a parent and child relation using set in hbm. In the action I am using session.saveOrUpdate() method to save but while s

相关标签:
14条回答
  • 2021-01-01 11:40

    please do not set id of child class which is generator class is foreign only set parent class id if your parent class id is assigned... just do one thing dont set id of child class via setter method your problem will be fix.....definately.

    0 讨论(0)
  • 2021-01-01 11:40

    if The given id is not exist in the DB ,then you may get this exception.

    Exception in thread "main" org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: 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
    
    0 讨论(0)
提交回复
热议问题