Bug report #21807

WFS update and delete transaction doesn't work (sometimes)

Added by Bo Thomsen almost 5 years ago. Updated almost 5 years ago.

Status:Open
Priority:High
Assignee:-
Category:Web Services clients/WFS
Affected QGIS version:3.4.6 Regression?:Yes
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29622

Description

I've encountered a strange and serious problem with the QGIS WFS driver

Setup :
  • QGIS 3.4.6 (Latest LTR and earlier versions)
  • WFS server GeoServer ver. 2.14 on windows server 2012
  • MS-SQLServer ver 2012 databaseserver.

Sometimes - NOT always - when I either edit or delete an object in a WFS layer in QGIS and save the result to the underlying SQL Server datasource, the fid value for the object to be updated or deleted is "forgotten" and the transaction dies.

After much shedding and whitening of hairs, I think I found the culprit: QGIS seems sometimes - not always - to make a faulty WFS post request to the GeoServer.

Insert always work, and fetching of data works too.

The error occurs in all the wfs layers from the WFS server. It is not limited to one specific layer

See the attached logfile containing information from both the GeoServer log and SQLServer profile tool.

I can send a QGIS project file with a read/write connection from the internet to the WFS server on request - Send a mail to or make a request using an update to this issue report.

Extract from the log file:
+++++++++++++++++++++++++++++++++++++++++++++++

Update, doesn't work.................................................................. =========================================================================================

Geoserver log for update transaction (set a field called "hoejde" to a value of: 9.88 in layer v_greg_linier

Notice the identification of the object in the post request to Geoserver:
.....<FeatureId xmlns="http://www.opengis.et/ogc" fid="v_greg_linier.null"/></Filter></Update></Transaction>

Notice the where condition in the sql statement:
UPDATE "PARKER"."v_greg_linier" SET "hoejde" = 9.88 WHERE 0 = 1

A working update , set field "hoejde" to: 6 in layer v_greg_flader ................................................................. ======================================================================
Notice the id in the post request to geoserver:
.....<FeatureId xmlns="http://www.opengis.net/ogc" fid="v_greg_flader.7399"/></Filter></Update></Transaction>

Notice the corresponding sql statement in sqlserver
UPDATE "PARKER"."v_greg_flader" SET "hoejde" = 6 WHERE ("ID" = '7399')
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Regards Bo Victor Thomsen

transactions-geoserver-sqlserver.txt Magnifier - logfile from geoserver and sqlserver (32.8 KB) Bo Thomsen, 2019-04-09 08:33 AM

History

#1 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Open to Feedback
  • Assignee deleted (Bo Thomsen)

Why tagged as a regression? Did it worked as expected in any qgis release < 3.4.6?

#2 Updated by Bo Thomsen almost 5 years ago

It worked in 2.18, but AFAIK not in any of the 3.x versions

The error is elusive... You can make maybe 30 edits working perfectly, and then suddenly QGIS stops working.

#3 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Feedback to Open
  • Crashes QGIS or corrupts data changed from Yes to No
  • Priority changed from Normal to High

#4 Updated by Bo Thomsen almost 5 years ago

Update May 1. 2019 !! If someone requires access to a setup with a Geoserver hooked up to a test database and a QGIS project for testing purposes, you have to send a mail to not

Also available in: Atom PDF