[Geoserver-devel] Error using Oracle: SQL Error occured when generating unique key

Hello,

I am trying to get Geoserver working on an Oracle table containing lines.
But when requesting for features, I get an error back:

<ServiceException locator="cl_boundary_stripped">
      While getting connection to datasource:
org.geotools.data.DataSourceException: SQL Error occured when generating
unique key
</ServiceException>

In the stdout.log (from Tomcat4.1.27) I have seen that Geoserver detects FID
as the OBJECTID, but in the error-log (stderr.log) OBJECTID is said to be an
invalid identifier. I have defined a primary key though for the table on one
field (FID, type NUMBER) and I have created a spatial index (although I'm
not sure Geoserver needs that). The values for FID are taken using a
sequence in Oracle, so the values in FID are unique. Still Geoserver is
throwing the error. Does Geoserver have any other requirements for the
identifier? E.g. should it be of a certain type?

Thanks in advance!

Oh, I have another (more general) question: should Geoserver be able to work
on tables containing more than one column of type mdsys.sdo_geometry, e.g. a
table containing features with geometry and boundingboxes per feature?

Thanks!

Thijs Brentjens

Hi Thijs,

Firstly, thank you for your issue reporting, it has been very valuable in improving Geoserver's Orace support.

To address your issue I really need a log file with the log level set to FINER, this is because that DataSourceException may contain an nested exception that has the details of the error. The Oracle connector should properly detect the primary key column and use it for the FID, the unit tests test this. So once I have seen your log files I may get you to run a little test program that checks if the oracle drivers are correctly reporting the primary key of that table.

On the multiple geometry issue, this may not work in the current version, however the Oracle implementation of the new version of geotools data API should support this. The new version is complete and I believe Chris is in the process of rolling the changes into Geoserver so you should not have to wait long.

Anyway, I will be able to help you more once I see the more detailed log files.

Thanks,
Sean

Thijs Brentjens wrote:

Hello,

I am trying to get Geoserver working on an Oracle table containing lines.
But when requesting for features, I get an error back:

<ServiceException locator="cl_boundary_stripped">
     While getting connection to datasource:
org.geotools.data.DataSourceException: SQL Error occured when generating
unique key
</ServiceException>

In the stdout.log (from Tomcat4.1.27) I have seen that Geoserver detects FID
as the OBJECTID, but in the error-log (stderr.log) OBJECTID is said to be an
invalid identifier. I have defined a primary key though for the table on one
field (FID, type NUMBER) and I have created a spatial index (although I'm
not sure Geoserver needs that). The values for FID are taken using a
sequence in Oracle, so the values in FID are unique. Still Geoserver is
throwing the error. Does Geoserver have any other requirements for the
identifier? E.g. should it be of a certain type?

Thanks in advance!

Oh, I have another (more general) question: should Geoserver be able to work
on tables containing more than one column of type mdsys.sdo_geometry, e.g. a
table containing features with geometry and boundingboxes per feature?

Thanks!

Thijs Brentjens

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel