Reputation: 129
I am developing an application which uses a H2 database. Used this tech in the past with no issues, but when downloading a fresh copy of the h2 database and running the jar, I am unable to login using the default settings! I am running h2-1.4.200.jar
and am greeted with:
General error: "java.lang.IllegalStateException: Unable to read the page at position 2199023614787 [1.4.200/6]" [50000-200] HY000/50000 (Help)
I am trying to run the default settings just to connect to the database but nothing seems to work. I have tried the following but with no luck, as well as a few other sources on github etc:
Embedded H2 Database “NonTransientError: Unable to read the page at position” error?
I am using the following dependency in my project:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
</dependency>
and downloaded the corresponding H2 database with the same version - 1.4.200
Has anyone else experienced issues like this in the past with the H2 database? The error I am receiving is in the following images:
H2 database console error 1:
Any help would be greatly appreciated, I have also tried to downgrade to version 1.4.190 both in my maven dependency and also the version of h2 running - h2-1.4.190
!
Upvotes: 1
Views: 6633
Reputation: 1467
It is also possible that the DataBase files got corrupted or something messed up the DB structure and it is not readable now
It is bit difficult to find out what went wrong, but you can create new DB and use it. No need to change H2 version.
In my case i was using file based database like this
C:/Users/ashish/data/code_base/H2/H2
So i just changed the file name to create new database again like below and it worked
C:/Users/ashish/data/code_base/H2/NEW_H2
Upvotes: -1
Reputation: 129
This was resolved by downloading a different version 1.4.199
The latest stable version. Looks to be some sort of bug with 1.4.200!
As mentioned in this post github.com/h2database/h2database/issues/2078
Upvotes: 8