Home > geoserver > Releasing GeoServer WFS-T Feature Lock

Releasing GeoServer WFS-T Feature Lock

May 24Hits:4

For some reason I'm having trouble finding any documentation about releasing feature locks in a GeoServer WFS (or any WFS for that matter).

I can easily request a FeatureLock with a request like this http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&typeName=namespace:layer_name&maxFeatures=1&outputFormat=json&request=GetFeatureWithLock&cql_filter=Id%3D0

I have read that an update will release the feature lock once completed, but what if my user cancels? Should I just update the feature with its original data, or wait for the lock to time-out? Looking through the WFS GetCapabilities response I thought I could make a LockFeature request and pass a ReleaseAction parameter, but this didn't work out. The URL was http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&typeName=namespace:layer_name&maxFeatures=1&outputFormat=json&request=LockFeature&releaseAction=ALL&cql_filter=Id%3D0 but the result was 'A LockFeature request must contain at least one LOCK element'.

The GetFeatureWithLock response didn't include any new lock identifier, and there are no cookies in the response headers, so I don't really understand how I'm supposed to release the lock I just created.

Any thoughts on this would be very much appreciated!


WFS locking is so seldom used that the best documentation about the usage can be found from the WFS standards.

Locks are only released after successful transaction or after the expiry period is passed. In WFS standard 1.1.0 default expiry time for locks is 5 minutes

<xsd:attribute name="expiry"
use="optional" default="5"/>

In WFS 2.0.0 the unit is changed and the default value is 300 seconds.

<xsd:attribute name="expiry" type="xsd:positiveInteger"

Thus clients can set the expiry time with optional expiry parameter. As far as I can see the WFS standard does not set any limits for how long expiry time client can use so I believe that nothing prevents to set it to for example 100000 minutes.

When it comes to forgotten locks, WFS 2.0.0 does not say anything about releasing them. Best information can be found from WFS 1.1.0 standard and that is not much: "This specification does not constrain how long a lock should be held if the expiry attribute is not specified. However, it would be prudent for a web feature service implementation to include methods to detect and release locks that have been maintained for a long period of time without any transactions being executed to release them."

What is new in WFS 2.0 is AutomaticDataLocking that means: "Indicates that the transaction operation automatically locks data in order to maintain consistency thus alleviating the client from having to use the LockFeature or GetFeatureWithLock operations to lock the features to be modified." It is obviously introduced in order to allow server makers to implement their own locking system.

Related Articles

  • Releasing GeoServer WFS-T Feature LockMay 24

    For some reason I'm having trouble finding any documentation about releasing feature locks in a GeoServer WFS (or any WFS for that matter). I can easily request a FeatureLock with a request like this http://localhost:8080/geoserver/wfs?service=WFS&ve

  • Geoserver WFS-T "Feature type 'Workspace:Layer' is not available" Error on update / deleteDecember 1

    I am using the following code for insert / update (changed from this source: http://wordpress-dbauszus.rhcloud.com/?p=71): var formatWFS = new ol.format.WFS(); // GML Format zur Interaktion mit WFS var formatGML = new ol.format.GML({ featureNS: 'http

  • Geoserver WFS get feature doesn't work - "SyntaxError: missing ; before statement"

    Geoserver WFS get feature doesn't work - "SyntaxError: missing ; before statement"December 3

    I'm trying to use geoserver WFS json for creating vector layer (instead of using WMS) because this is a layer I redraw every 20 seconds. This is the code I use : function getJSON() { var geoJsonUrl = "http://localhost:8080/geoserver/test/ows?service=

  • Geoserver WFS features query inaccurate using SQL Server Backend with spatial indexOctober 1

    I´m using Geoserver to query features through WFS in an Web Application with Openlayers as client. The queried layer is using SQL Server as backend storage. When applying a spatial index to the queried layer in SQL Server, the response of an identify

  • Dynamically adding WFS layer features with GeoserverMarch 15

    I am investigating using Geoserver to output new WFS layer features dynamically. We have a backend process that will be generating new WFS features periodically that will be placed in a datastore (most likely PostGIS). I plan on creating a WFS layer

  • Geoserver WFS 2.0 CSV Output Multiple Features/typeNamesJanuary 27

    I'm setting up an export function so that users may download data from a Geoserver WFS 2.0 service in a variety of the supported formats. The service has multiple FeatureTypes which should be available for export in a single query (along with BBOX an

  • Oracle / GeoServer / WFS-T / Openlayers many polygons as one featureFebruary 26

    Newbie question regarding Oracle / GeoServer / WFS-T / Openlayers. I am creating a table that will hold geometry features a user creates/updates. My question is, I would like to have just one record in the table per customer (customerId). Can I creat

  • GeoServer polygon intersecting features of WFS November 12

    How to get all the features intersecting a polygon using wfs.I am able to get all the features from WFS geoserver but dont know how to pass a polygon to get only specific features which are intersecting with the polygon.Please provide few lines of co

  • geoserver wfs insert errorApril 27

    I keep getting an insert error from geoserver when trying to save a point, poly etc etc to my postgis table. any ideas, my code is below var Projection = new OpenLayers.Projection("EPSG:4326"); var map = new OpenLayers.Map("Map", { //p

  • GeoExt printPage cannot handle WFS vector featuresOctober 20

    I recently added the print function to my GeoExt web application, using <script type="text/javascript"src="http://localhost:8080/geoserver/pdf/info.json?var=printCapabilities"></script> to define the printCapabilities varia

  • OpenLayers call ArcGIS WFS: no feature returnedJanuary 24

    I spent a long time looking for an example using OpenLayers to call ArcGIS WFS, however, almost none is found... currently the code I wrote is based on the example of GeoServer, however, no feature is returned... new OpenLayers.Layer.Vector("ArcGIS W

  • Allow GeoServer WFS request by featureIDApril 6

    I'm not able to use the featureID parameter in a WFS URL request for my dataset on GeoServer. Example: http://demo.opengeo.org/geoserver/wfs?version=1.1.0&service=wfs&request=GetFeature&typeName=topp:tasmania_roads&maxFeatures=10&featu

  • GeoServer WFS OpenLayers EditingPanel ProblemJune 13

    I'm trying to use OpenLayers to edit features of vector data served from a local geoserver. So far, I'm able to pull WMS and WFS layers using OpenLayers from the same geoserver. But now, I'd like enable editing of features of the vector layers. The r

  • Can I prevent OpenLayers from losing my WFS-T feature edits?March 21

    Using openlayers (2.12) and drawing some vector features against a WFS-T interface (offered by geoserver). Problem is, when I draw some geometries and pan a little bit too much, openlayers sends "wfs:GetFeature" message to WFS-T interface, and w

  • What's the correct link for adding GeoServer WFS to ArcMap?

    What's the correct link for adding GeoServer WFS to ArcMap?January 27

    What is the correct URL to enter in ArcCatalog WFS Parameters when adding a WFS layer from GeoServer into ArcMap? Here's a link to our Get Capabilities document: https://weaveprod.ucdp.utah.edu/geoserver/ows?service=wfs&version=1.0.0&request=GetCa

  • GeoTools WFS Query sortBy not working for GeoServer WFSFebruary 17

    I am using GeoTools to query a GeoServer WFS using the following code: Map connectionParameters = new HashMap(); connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", String.format("%s&request=GetCapabilities", wfsUr

  • Accessing GeoServer WFS services in ArcGIS Online map viewer?September 9

    Has anyone was able to add GeoServer WFS service into ArcGIS Online map viewer? By this I mean having an ArcGIS Online account (either free or for Organizations), logging in and adding layers from the web. I have no problems adding a WMS service such

  • What causes these geometry differences between original PostGIS data and Geoserver WFS?

    What causes these geometry differences between original PostGIS data and Geoserver WFS?January 4

    Why does GeoServer (v2.5.1) WFS layer (see red line/layer below) not overlay features of source PostGIS table or related WMS layer in QGIS (tested in v2.6 and 2.12)? All layers are defined in the same GCS (EPSG: 4326) (interstate Tiger shp data origi

  • Drupal-Geoserver WFS error September 24

    I am having trouble getting a WFS layer working using Geoserver, OpenLayers and GeoExt. I get the following error: XMLHttpRequest cannot load Origin is not allowed by Access-Control-Allow-Origin

  • How to add GeoServer wfs layer on OpenLayers?

    How to add GeoServer wfs layer on OpenLayers?March 4

    I can't seem to add a WFS layer like this. It works when i copy all this code locally but as soon as i change the values to point to my own layer within my own GeoServer this is the response viewed in firebug: Could not locate {http://www.mydomain.co

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.494 s.