Programmers learn & share
0 votes

Problem :

I am stuck with following strange looking Hibernate error
batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
by (6.9k points)   | 68 views

1 Answer

0 votes

Solution :

To resolve your issue follow following steps:

  • In hibernate configuration firstly set hibernate.show_sql to true. It shows you the SQL that is geting executed and causing the problem.
  • Next set the DEBUG log levels for Spring and Hibernate which will give you a better idea as to which line is causing the issue.
  • Lastly you need to create a unit test which should replicate the problem without configuring a transaction manager in Spring. This should give you a better idea of the offending line of code.

This will solve your issue.

by (36.1k points)  
2,204 questions
2,605 answers
241 users