Skip to content

bug: Updating to 4.3.1 causes existing databases to no open correctly #1162

Description

@DarkAtra

It seems like #1117 breaks support for databases created with 4.3.0 - at least when working with repositories. The following exception is thrown:

Caused by: java.io.InvalidClassException: org.dizitart.no2.collection.NitriteId; incompatible types for field idValue
	at java.base/java.io.ObjectStreamClass.matchFields(ObjectStreamClass.java:2207)
	at java.base/java.io.ObjectStreamClass.getReflector(ObjectStreamClass.java:2128)
	at java.base/java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:658)
	at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2078)
	at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1927)
	at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2252)
	at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
	at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:540)

and the database is rolled back to an earlier version. In my case this was luckily caught in a test as it seems to result in a wipe of the collection in the database.

Reproducer: https://github.com/DarkAtra/nitrite-java/blob/v4.3.1-nitrite-id-issue/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/MyTest.kt#L75-L103

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions