Opened 12 years ago

Last modified 5 years ago

#4694 closed defect

Oracle driver writes to metadata table when reading — at Initial Version

Reported by: marcbria Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: OGR_SF Version: svn-trunk
Severity: critical Keywords: Oracle, OCI, OGR
Cc: msmitherdc, ilucena, andersmoe

Description

Connecting to an Oracle database and then disconnecting causes the Oracle driver to write updated extents information to the SDO_GEOM_METADATA_TABLE table.

If a user connects using a OCI connection string which specifies a table name but that name does not exist in the database or is not a spatial layer it is also written to the SDO_GEOM_METADATA_TABLE. If the user subsequently tries to connect and disconnect a duplicate record exception is thrown.

My proposed solution involves modifying ogrocitablelayer.cpp

  • Set the boolean flag bExtentUpdated to false during the OGROCITableLayer() constructor. This way when the connection is destroyed and SyncToDisk() gets called the UpdateLayerExtents() method will not save updated extents to the SDO_GEOM_METADATA_TABLE unless new features have been added or removed.
  • Restore the code in UpdateLayerExtents() which looks for a degenerate extent and does not update the SDO_GEOM_METADATA_TABLE accordingly.

I've made these modifications on my own and they do not appear to have any adverse effects however I don't have a complete understanding of the OGR drivers and I'm not sure what ramifications it may have.

Change History (0)

Note: See TracTickets for help on using tickets.