[Geoserver-devel] [JIRA] (GEOS-7681) WFS Insert operations produce SQL that includes identity column; SQL Server plugin then fails to insert

Chris Michaelis created an issue

GeoServer / BugGEOS-7681

WFS Insert operations produce SQL that includes identity column; SQL Server plugin then fails to insert

Issue Type:

BugBug

Affects Versions:

2.10-beta

Assignee:

Unassigned

Components:

SQLServer

Created:

15/Aug/16 9:47 PM

Priority:

MediumMedium

Reporter:

Chris Michaelis

Hi there!

Using the latest 2.10 snapshot from a few days ago (Aug 11, I believe it was), the SQL Server plugin no longer seems to insert a row in response to a WFS insert transaction. This had been working previously on 2.8 before upgrading to the latest snapshot.

The insert transaction just provides a coordinate, no attributes. The SQL Server table has a featid column defined as a primary key, with an insert identity defined. GeoServer sends a query like this (observed using SQL Server Profiler):

INSERT INTO “dbo”.“redacted” ( “classid”,“revisionnumber”,“geometry”,“id2”,“easting”,“northing”,“point_id”,“photo2”,“photo1”,“featid” ) VALUES ( 0,0.0,geometry::STGeomFromText(‘POINT (redacted redacted)’,32614),null,null,null,null,null,null,35220)

…which makes SQL Server say:
Msg 544, Level 16, State 1, Line 2
Cannot insert explicit value for identity column in table ‘redacted’ when IDENTITY_INSERT is set to OFF.

Ideally, because featid has an identity defined, that field can just be left off of the query, and it ought to work fine, according to my understanding. As a workaround for now, just removing the identity from the table definition works, but is not ideal.

Thank you!

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.245.0#100009-sha1:7349d1f)

Atlassian logo