Issue #611: NoResultException: No matching results for a unique query

Type: Bug ReoprtPriority: NormalStatus: ClosedReplies: 6
#1

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

#2

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

 

Alex

#3

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
#4

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

#5

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
#6

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

#7

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

Reply