Problem: When some of my layers are published by Geoserver 2.8.0 and added as WFS layer in QGIS 2.16.0 some of the data are duplicated. The duplicated data do not have geometry. I have observed this in two layers that I am serving but it is not consistent with all of them. However for those two layers the same does NOT apply when the data are imported in FME 2016 or ArcGIS 10.3.1 using the interoperability extension.
Background: The geoserver layers are held as 'views' in a PSQL 9.4 server which sits in Ubuntu 14.04. The views are generated using a statement of the following form:
CREATE OR REPLACE VIEW geoserver_view AS ( SELECT column_1, column_2, column_3, ..., geom FROM schema_name.table_name )
I have also tried creating or replacing the views using the following form of view creation as suggested in the Duplicate entries in table list when adding PostGIS layer in QGIS but I observed the same records duplication.
CREATE OR REPLACE VIEW schema_name.geoserver_view AS ( SELECT column_1, column_2, column_3, ..., geom::Geometry(MultiPolygon, 27700), FROM schema_name.table_name )
I think that QGIS is probably the problematic software here since I have checked the data in PSQL and they are fine, and when importing the WFS in other software no record duplication is observed.