Primary Key Lookup fails for Oracle tables with underscores in their name

Description

When inserting features into a table in an Oracle Datastore, if the table name contains underscores, then:
The primary key lookup will fail:

Because the primary key lookup fails, the primary key is null and we get a read-only FeatureSource, causing the insert to fail:

This is particularily notable when using the importer extension to import shapefiles.

It looks like this error is related to the changes made here: https://github.com/geotools/geotools/commit/3a98d302b9f41006e33da51cc107ba7449e471f9 (Fix for )

seems to be caused by a similar problem.

Environment

Oracle 11.2 running on Windows 2003 server.
Issue was observed on various remote instances of GeoServer 2.7

Activity

Show:
Torben Barsballe
April 30, 2015, 11:19 PM
Edited

Digging through this in the debugger, it looks like store.escapeNamePattern(metaData, tableName) escapes _ to //_, causing the table name to be invalid and the result set to contain no results.

Torben Barsballe
May 1, 2015, 4:34 PM
Edited

Sebastian Graca, who fixed GEOT-4912, has pointed out that this is a problem with the ojdbc14 driver, and can be fixed by updating to a newer version, such as ojdbc7.jar

GeoTools expects ojdbc7.jar as of version 14.

I have tested with the ojdbc7.jar on GeoServer 2.8 / GeoTools 14, and can confirm the issue is fixed when using this configuration.

Replacing ojdbc14 with ojdbc7 in an existing GeoServer install also works.

Assignee

Unassigned

Reporter

Torben Barsballe

Triage

None

Components

Fix versions

Priority

Medium
Configure