-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Error Code: 50000 Unable to read page at position <number> after connecting to DB with Intellij Database Tool #2204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you check what version of H2 that tool actually uses? |
This issue was reported here #2078 (comment) and on the SO. 1.4.196 and 1.4.200 were used together. @grandinj |
Unfortunately, the create version is available only on late stages of database initialization, so it can be complicated. |
Also the newer versions don't upgrade the database format and version in metadata. |
There is no "create version" in the header or elsewhere. Instead "format" and "formatRead" should be used and related logic is already in place. Unfortunately hard-coded constants, that fields compared against, were not incremented when they probably should've been.
Field "format" is written into the header of a newly created databases with value of FORMAT_WRITE, and it's never updated afterward, because it is a format of a database itself. |
I meant H2 database, not the standalone MVStore / TransactionStore. H2 database has a |
In some cases incompatibilities can be caused by the database itself. For example, there was an incompatible change between 1.4.196 and 1.4.197 in foreign key constraints that affects both PageStore and MVStore. (We fixed upgrade procedure of MVStore in more recent versions.) We can't fix the behavior of already released versions, but we can improve it for a new releases. Some other database systems perform an automatic or semi-automatic upgrade of old database files. I think we need to do the same when we know that new version is not fully compatible with older one that was used to create the database. And database should at least reject writes to a database file that was created by a newer version to avoid its corruption. |
Agreed |
* Create a DB connection * - make Authenticator polymorphic (XML & DB) - start writing DB auth * Use DBAuthenticator, experiment with DBs (connection established, table not found) * Add the simplest check * Downgrade h2 to 1.4.196 to avoid h2database/h2database#2204 * Post-merge changes
I met the same problem and when I changed |
@Koooooo-7 |
I had just connected with the intellij db console to one of my h2 databases, and upon starting my spring boot app again I was greeted with Downgrading from |
Got same error. Downgrading h2 version from 1.4.200 back to 1.4.199 worked for me too. |
Please , how to does h2 version from 1.4.200 back to 1.4.199 ? |
@ferhad266 I guess you are working with spring - maven project, to downgrade just make sure to have explicit versioning for h2 dependency in you pom.xml file
|
This issue is fixed in 2.0.202 and later versions. They don't try to read files in incompatible formats and they mark own files as incompatible with old unsupported versions. |
Problem: I am executing some Unit-Tests using JPA and H2 that are persisting objects inside the DB. After that I connect to the local database via the Intellij Database Tool. After disconnecting and running the Unit-Tests again. I get the following exception:
Downgrading the H2 dependency in maven from 1.4.200 to 1.4.199 fixes the problem.
Now I can run the tests again after connecting and disconnecting from the DB.
The text was updated successfully, but these errors were encountered: