Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

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"
type="xsd:positiveInteger"
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"
default="300"/>

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.