Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Query returns always the same object
[CDO] Query returns always the same object [message #1735757] Wed, 22 June 2016 13:37 Go to next message
Philippe Fry is currently offline Philippe FryFriend
Messages: 8
Registered: April 2012
Junior Member
Hello,

I made a CDOQuery like explained here 'https://wiki.eclipse.org/Query_DB_Store_by_using_SQL' but the return CloseableIterator always returns the same object when calling the .next() method.

Note that I have set setParameter("firstResult", int) on the query (for pagination purposes), if i don't there is no problem and the iterator give me different objects each time i call .next() method

The problem does not occurs with CDO 4.2, and appears since we a are migrating to 4.4

In SQLQueryHandler.java:217 i notice that there is a "while (firstResult > -1 || resultSet.next())", for me: "firstresult" is always > -1, so resultSet.next() is not call and the cursor does not move in the resultSet.

Do you think it can be a bug, or i missunderstood something, not using the API as expected ?


Thanks !
Re: [CDO] Query returns always the same object [message #1735986 is a reply to message #1735757] Fri, 24 June 2016 08:24 Go to previous message
Per Sterner is currently offline Per SternerFriend
Messages: 91
Registered: October 2011
Member
I setup a test (ZEclipseForum1078633.java).

I did 3 checks:

firstResult: -1
maxResult: 5

-> OK Returns 5 different Element

firstResult: 1
maxResult: 5

-> Wrong? Returns 5 times the item at offset 1

firstResult: 1

-> Runs forever

(I used: cdo-4-4-maintenance, H2, JVM-Connector)
Previous Topic:Specifying the model for the sirius
Next Topic:[CDO] Problems with concurrent transactions
Goto Forum:
  


Current Time: Thu Apr 25 13:42:14 GMT 2024

Powered by FUDForum. Page generated in 0.03004 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top