299 words

wrong query result

#1
2014-01-30 11:04

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

peric.emil
peric.emil's picture
Joined on 2013-03-28
User Post #23
#2
2014-01-31 13:05

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)
support
support's picture
Joined on 2010-05-03
User Post #1,767
#3
2014-02-07 08:25

Thanks for help,

there havent been any similar problems since.

 

Regards.

peric.emil
peric.emil's picture
Joined on 2013-03-28
User Post #24

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel