Coder Social home page Coder Social logo

Comments (10)

nprigour avatar nprigour commented on August 18, 2024 1

Hi @akater320,
Following your advice I checked by replacing the DiffFeatureReader constructor with the one that contains also the Filter parameter (in the suggested line 619 of ContentFeatureSource) and it seems that the problem is resolved in what concerns multiply editing actions in Shapefiles (JDBC layers also seem unaffected by this change). That is great!
@akater320 do you have an account in geotools project? If yes would it be possible to create a jira ticket in geotools (https://osgeo-org.atlassian.net/projects/GEOT/issues) describing the problem and possibly also referencing the present issue to justify the problem? Then you can proceed with providing a PR fix on geotools github.
Note: as far s I know, geotools is now in version 21.x which has a lot of changes compared to v19.4 used by udig (also it is probably not under support anymore) but I am sure the problem is still present. Anyway let's propose a fix and we may ask later how we can backport it to v19.x.

from udig-platform.

akater320 avatar akater320 commented on August 18, 2024 1

https://osgeo-org.atlassian.net/projects/GEOT/issues/GEOT-6293

from udig-platform.

nprigour avatar nprigour commented on August 18, 2024

This is quite a serious bug. I just check it and indeed the behaviour if you try to edit more than one feature without prior committing the changes is really weird!
It seems also that the issue is present for quite some time, maybe from upgrading to geotools 19.x. I wonder how this got unoticed for such a long time (to be honest I work almost solely with jdbc layers where the problem seems not to be present)!!
@akater320 are you sure that the issue stems from the ContentFeatureStore? Moreover are you aware whether it has been fixed in subsequent geotools versions?
@fgdrf I think we should urgently ask a question about this to the geotools team and request their counsel.

from udig-platform.

nprigour avatar nprigour commented on August 18, 2024

Checking a little bit further it seems that we have this issue in udig even in version 2.0.0 that uses geotools 14.1. I had to go 4-5 years back in time that is udig 1.4 and geotools 9.0-M0 to see correct behavior during multiple edits of a shapefile layer!

from udig-platform.

akater320 avatar akater320 commented on August 18, 2024

Thanks for confirming.
The problem probably this line:
https://github.com/geotools/geotools/blob/e40158adf59a37d985133184968f251d9a8ff4f8/modules/library/main/src/main/java/org/geotools/data/store/ContentFeatureSource.java#L619

It should be using the constructor with the Filter parameter.
https://github.com/geotools/geotools/blob/e40158adf59a37d985133184968f251d9a8ff4f8/modules/library/main/src/main/java/org/geotools/data/DiffFeatureReader.java#L93

The default filter is Filter.INCLUDE, so queryAdded() will return everything rather than only the features matching the user's query.
https://github.com/geotools/geotools/blob/e40158adf59a37d985133184968f251d9a8ff4f8/modules/library/main/src/main/java/org/geotools/data/DiffFeatureReader.java#L211

from udig-platform.

akater320 avatar akater320 commented on August 18, 2024

FYI: You may encounter this issue while testing with ShapeFiles.
geotools/geotools@a26e08b

from udig-platform.

nprigour avatar nprigour commented on August 18, 2024

But @akater320 I cannot understand if the problem is indeed where you mention, shouldn't all FeatureSources be affected since this method getReader is final and used by all FeatureSources that inherit from the ContentFeatureSource (that is to say all type of sources)? I.e. I work for some years with JDBCFeatureSources (MySQL) in udig and the problem surely not present there!

from udig-platform.

akater320 avatar akater320 commented on August 18, 2024

Excellent point @nprigour
It looks like JDBCFeatureStore delegates read-only operations to JDBCFeatureSource which handles transactions intrinsically.
https://github.com/geotools/geotools/blob/e40158adf59a37d985133184968f251d9a8ff4f8/modules/library/jdbc/src/main/java/org/geotools/jdbc/JDBCFeatureStore.java#L211
https://github.com/geotools/geotools/blob/e40158adf59a37d985133184968f251d9a8ff4f8/modules/library/jdbc/src/main/java/org/geotools/jdbc/JDBCFeatureSource.java#L544

JDBCFeatureReader never gets wrapped by a DiffFeatureReader in this block.
https://github.com/geotools/geotools/blob/e40158adf59a37d985133184968f251d9a8ff4f8/modules/library/main/src/main/java/org/geotools/data/store/ContentFeatureSource.java#L616

from udig-platform.

nprigour avatar nprigour commented on August 18, 2024

Hi @akater320,

would it be possible to revise the https://osgeo-org.atlassian.net/projects/GEOT/issues/GEOT-6293 jira issue according to what I am proposing in geotools/geotools#2604 (see my latest comment) so that we can proceed with the geotools fix. If you are unable to rename the issue and/or its description, please inform back so that I generate another one and we set the GEOT-6293 as duplicate.

from udig-platform.

jodygarnett avatar jodygarnett commented on August 18, 2024

The fix for this is being included in GeoTools 22.1.

from udig-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.