Home » Support » Forum » wrong query result

wrong query result

#1

Hi we have a problem with queries, database is returning wrong results.

These are the queries we run from ObjectDB explorer.

Query 1 - SELECT MAX(e.generisaniID) FROM AktImpl e – returns string (from field e.brojAkta) although field generisaniID is of type long.
Query 2 - select e.idRecord, e.generisaniID from AktImpl e- returns string (from field e.brojAkta) although field generisaniID is of type long. Retuned value from field idRecord is correct.
Query 3 SELECT e FROM AktImpl e – returns correct results
We had this problem on records created on 13 and 14 January, problem was detected yesterday when bug was detected in application.
We found a workaround by manually (through queries) changing the values of filed brojAkta in a way that we deleted the original values, saved the database and then inserted that value again and saved the database.
Repairing the database didn’t help,
Attached are a db repair log and a screenshot of queries and results. We will upload the DB through private issue ticket on which you can run these queris

Thanks for help

#2

As discussed in a previous thread, this is the undesired consequence of using ObjectDB with different versions of entity classes concurrently. When you upgrade your schema you must make sure that the ObjectDB server is down and that only the new versions of the entity classes are in use by the system after starting the server again.

The attached pictures demonstrates the problem. You can see that class pbdmodel.impl.AktImpl has 161 versions. Generally speaking, new versions are only created by adding or removing persistent fields. Obviously this didn't happen so many times. You can also see that the number of fields (Content-Members) is changed alternately (48/49, 51/52), which indicates that different versions of that entity class competed one with the other causing massive version creation.

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

Thanks for help,

there havent been any similar problems since.

 

Regards.


Post Reply

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