• Register
0 votes
166 views

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
6.9k points

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.

38.6k points

Related questions

0 votes
1 answer 2.4K views
2.4K views
Problem : I am getting bellow error while using hibernate JPA with spring and mongodb and running my application on Glassfish-4.0. javax.persistence.transactionrequiredexception: executing an update/delete query
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
1 answer 583 views
583 views
Problem : I am trying to display Data from DB.But facing error as followsthe server encountered an unexpected condition that prevented it from fulfilling the request.
asked Nov 15, 2019 peterlaw 6.9k points
0 votes
1 answer 309 views
309 views
Problem : I am updating values using JDBC but getting bellow error java.sql.sqlexception: column count doesn't match value count at row 1
asked Oct 31, 2019 peterlaw 6.9k points
0 votes
1 answer 24 views
24 views
Problem: I am working on Hibernate and now I am facing what I believe is a simple problem with the Hibernate but still I can't solve it. I have written a simple class I would like to persist but still keep facing below error: SEVERE: Field 'id' doesn't have a ... that is not working for me. Initializing the id also did not help me either! I am looking for Hibernate expert to fix my above error.
asked Jul 30 Raphael Pacheco 4.9k points