Uploaded image for project: 'GeoServer'
  1. GEOS-7681

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


    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.10-beta
    • Fix Version/s: 2.9.3, 2.10.0
    • Component/s: SQLServer
    • Labels:


      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!


          Issue links



              • Assignee:
                aaime Andrea Aime
                cmichaelis Chris Michaelis
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: