Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeatureResultSet.moveToFirst() does nothing. #50

Closed
AKShaw opened this issue Mar 27, 2020 · 2 comments
Closed

FeatureResultSet.moveToFirst() does nothing. #50

AKShaw opened this issue Mar 27, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@AKShaw
Copy link

AKShaw commented Mar 27, 2020

Please fill out as much known and relevant information as possible.

Version Information:

  • GeoPackage Java Version: 3.4.0
  • GeoPackage Java Source: Maven repo
  • IDE Name & Version: IntelliJ march 2020 version
  • Java Version: JDK 1.8
  • Platform & OS: Windows

Expected Results:

  • What did you expect to happen?

Expected cursor to move to the first row of the table

Observed Results:

  • What happened instead?
    Cursor didnt move at all
  • How often does this occur?
    100%

Output:

  • Any logs, errors, or output messages?
    0
    1
    2
    2

Steps to Reproduce:

  1. Create a non empty FeatureResultSet by querying a DAO
  2. Print resultSet.getPosition()
  3. Call resultSet.moveToNext()
  4. Repeat 2, 3 as many times as you want
  5. Call resultSet.moveToFirst()
  6. Print resultSet.getPosition()

Relevant Code:

FeatureResultSet frs = dao.queryForAll();
System.out.println("Current pos: " + frs.getPostition());
frs.moveToNext();
System.out.println("Current pos: " + frs.getPostition());
frs.moveToNext();
System.out.println("Current pos: " + frs.getPostition());
frs.moveToFirst();
System.out.println("Current pos: " + frs.getPostition());

Test Files:

  • Links to any files needed for testing?

Additional Information:

  • Any additional configuration, data, or information that might help with the issue?
@AKShaw AKShaw added the bug Something isn't working label Mar 27, 2020
@bosborn
Copy link
Contributor

bosborn commented Apr 1, 2020

The utilized SQLite JDBC library is TYPE_FORWARD_ONLY (statements can not be created with scroll types). For your example, close the result set and perform the query again. Made a few changes for the next version that will throw an exception in that case.

@bosborn
Copy link
Contributor

bosborn commented Apr 1, 2020

The geopackage-core-java interface is shared by both this and the geopackage-android library, which is why some of the implementations differ.

@AKShaw AKShaw closed this as completed Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants