Uploaded image for project: 'GeoTools'
  1. GEOT-5261

[jdbc-spatialite] Datastore removeSchema doesn't delete geometry_columns record for dropped table

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 14.0
    • Fix Version/s: 15.0
    • Component/s: jdbc-spatialite plugin
    • Labels:
      None

      Description

      So:

      spatialiteDatastore.removeSchema(typeName); // Remove apparently OK, but
      spatialiteDatastore.createSchema(featureTypeWithSameName); // Recreating it fails with:
      
      Exception in thread "main" java.io.IOException: Error occurred creating table
      	at org.geotools.jdbc.JDBCDataStore.createSchema(JDBCDataStore.java:757)
      	at org.geotools.jdbc.JDBCDataStore.createSchema(JDBCDataStore.java:144)
      Caused by: java.sql.SQLException: columns f_table_name, f_geometry_column are not unique
      	at org.spatialite.NativeDB.throwex(NativeDB.java:213)
      	at org.spatialite.NativeDB._exec(Native Method)
      	at org.spatialite.Stmt.executeUpdate(Stmt.java:152)
      	at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
      	at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
      	at org.geotools.data.spatialite.SpatiaLiteDialect.postCreateTable(SpatiaLiteDialect.java:414)
      	at org.geotools.jdbc.JDBCDataStore.createSchema(JDBCDataStore.java:754)
      	... 4 more
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oscarfonts Oscar Fonts
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: