2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

How to solve "StalestateException" in hibernate?

I am getting this error when I am trying to update values in my database from my spring mvc application :

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

can any explain what might cause this exception


userimage
what i have experienced is that this exception raise when updating object have an id which not exist in table. if you read exception message it says "Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1" which means it was unable to found record with your given id.
Answer is