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.
Oracle 11.2 running on Windows 2003 server.
Issue was observed on various remote instances of GeoServer 2.7
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.
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.