• Register
0 votes
87 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.

36.1k points

Related questions

0 votes
1 answer 1.6K views
1.6K 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 206 views
206 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 309 views
309 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 15 views
15 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 3.2k points
0 votes
1 answer 970 views
970 views
Problem : I am a completely novice in the hibernate world and facing below error, WARN: GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement The ... hibernate 4 version all my code runs very well. I looked for many solutions but they are not working for me.
asked Feb 4 jwilliam 3.9k points