Skip to content
Advertisement

org.hsqldb.HsqlException: discrepancy in the number of rows counted

I’m trying to play around with an insecure application (Insecure Bank) and I’m trying to port it to secure it a bit more as a personal project.

I have a problem inserting the contents of the database into a database in memory. There are these two tables:

And some of the values that are expected to be inserted are:

But when Hibernate tries to insert the values at the start of the application (I use an import.sql file in the resources folder) I get this error:

I’ve mapped the Entities like this:

But I don’t know where is the mistake or what I’m doing wrong.

As the suggestion by @SternK I’ve changed:

to

but now I get the error:

Advertisement

Answer

  1. I guess this:

should be corrected like this:

  1. As it suggested in this article:

Make sure you are mapping values to correct columns in query. Best way is to define column name and values in query as well.

So, I would suggest you to rewrite your insert statement in the following way:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement