Skip to content

[SQLFeatureStore] Deleting features fails for certain feature type prefix configurations #848

@MrSnyder

Description

@MrSnyder

We observed that a delete by feature id against an SQLFeatureStore fails in some cases. This issue seems to be related to certain feature prefix configuration and differs between Java versions, e.g. we have two feature types with the following feature id prefices:

  • APP_FEATURE_
  • APP_FEATURE_X

We found that deleting the feature with id "APP_FEATURE_X_1" works in a Java 7 setup (tested with OpenJDK 7, 1.7.0_151 on Ubuntu 14.04 AMD64), while it fails with an exception on Java 8 (same machine, Oracle JDK 8, 1.8.0_144).

A first analysis points to method analyze(String) in class org.deegree.feature.persistence.sql.id.IdAnalyzer:

...
        // TODO implement this more efficiently
        for ( String prefix : prefixToFt.keySet() ) {
            if ( featureOrGeomId.startsWith( prefix ) ) {
                ft = prefixToFt.get( prefix );
                break;
            }
        }
...

We believe this is caused by the different key order in the respective HashMap implementations:

https://stackoverflow.com/questions/38587711/hashmap-keyset-returns-keys-in-different-order-in-java-7-java-8

Metadata

Metadata

Assignees

Labels

WFSdeegree Web Feature Servicebugerror issue and bug (fix)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions