404 words

Issue #117 - NoResultException: No matching results for a unique query

BugVersion: Priority: NormalStatus: ClosedReplies: 6
#1
2011-12-10 12:08

I am very often getting a "com.objectdb.o._NoResultException: No matching results for a unique query" when modifying my already persisted entities within a transaction. I cannot replicate it however because it happens infrequently. The weird thing is that the entity nevertheless gets comitted perfectly right and all data is correctly written so I have no clue what's going on!??

Here's the stacktrace (copy+paste from debug output):

com.objectdb.o.MSG.d(MSG.java:61)
com.objectdb.o.PRG.af(PRG.java:692)
com.objectdb.o.PRG.ae(PRG.java:653)
com.objectdb.o.PRG.ad(PRG.java:539)
com.objectdb.o.QRM.U4(QRM.java:259)
com.objectdb.o.MST.U4(MST.java:947)
com.objectdb.o.WRA.U4(WRA.java:290)
com.objectdb.o.WSM.U4(WSM.java:113)
com.objectdb.o.STC.r(STC.java:447)
com.objectdb.o.SHN.aj(SHN.java:489)
com.objectdb.o.SHN.K(SHN.java:156)
com.objectdb.o.HND.run(HND.java:133)
java.lang.Thread.run(Thread.java:680)

thanks,

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #46
#2
2011-12-10 12:17

Funny enough, after restarting my application it works perfectly again.. so I really cannot replicate it so appreciate any help!!

 

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #47
#3
2011-12-12 19:43

The stack trace indicates a normal situation of executing a query that has no results, so more details are needed to understand the problem.

You wrote that this happens when a query is run after modifying entities in a transaction. By default, modifications of entities during transaction are usually (but not always) invisible to the query until commit. This behavior can be changed by modifying the flush mode. Which flush mode are using?

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #795
#4
2011-12-13 07:41

Hi,

I didn't change it so I am using the default Flush Mode (COMMIT). I don't get why this is happening, it just has happened again -> I simply modified an existing object within an active transaction and when comitting the transaction I get the given NoResult* exception eventhough changes are correctly comitted.

Could you please tell me why I do even get a NoResult* exception within a transaction commit that I've been using to modify something only? I've thought the NoResult* exception should happen on SELECT queries only???

 

thanks, this is really really annoying and turns the app quite unusable right now :(

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #48
#5
2011-12-13 10:36

More details are required. The stack trace in #1 indicates an exception during query execution and in #3 you refer to an exception during commit. Do you have a stack trace of that exception?

It is clear that you get a NoResultException that you do not expect. A test case that demonstrates it will be very helpful. If you cannot provide a test case - at least try provide all the details. This might not be sufficient for solving the problem but at least there will be a chance.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #800
#6
2011-12-14 07:36

Haha okay funny enough - my fault after all. I am implementing my own find() function which was causing the failure because of a filter.. sorry!!

Alex

quasado
quasado's picture
Joined on 2011-04-30
User Post #50
#7
2011-12-14 15:55

No problem and thank you for the update.

Isolating a problem by generating a simple test case is the best way to investigate and handle issues, either in ObjectDB or in applications that use ObjectDB.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #806

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