Home » Support » Forum » Wrong @Id type

Wrong @Id type

#1

Hi, 

I have noticed some values of id column suddenly switched to int, although it is declared as long in our java class.

Do you have idea why this happened?

Screenshot attached.

 

#2

There was a bug in UPDATE queries that was fixed. Please see this forum thread.

Which ObjectDB version are you using? Try the last ObjectDB version, which should fix this issue/ To repair IDs that have already changed their types you will have to 'touch' the objects and store them again, or use an ObjectDB version before the fix, with an UPDATE queries that change the IDs to the correct type).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

We are using ObjectDB 2.4.6_07 in our production enviroment and 2.5.6_02 version in our test enviroment.

I think we have a different issue from the one in the forum thread you mentioned because we don't use UPDATE queries.

Also we have noticed that using tree view of ObjectDB explorer the type of the id column is displayed as long, as it shold be, but selecting only id column from the database returns some of the ids as integers (screenshots attached). Iterating over a list of records gives ClassCastException.

Problem occurs in both (2.4.6 and 2.5.6) versions. In 2.5.6 version one of the record suddenly switched its id type, although it was created 10 days ago, and was working fine since then. In 2.4.6 version this never happened.

Thank you,

Pero

 

 

 

#4

Version 2.5.6 fixes a specific issue (related to UPDATE queries). Possibly there is another issue, but more information is needed in order to understand the cause.

If you can provide a test case that demonstrates an operation that changes the id type it would be very helpful.

Additional information may also help. What is special with that specific object (with id 13)? When an id type is changed? etc.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login