0

I am building collaborative mapping app using openlayers 5.3.0, geoserver 2.14.0 and postgresql 10.4. I want the user to be able to update features using wfs-t but before updating, the user needs to lock the feature so that no other users can update this feature before the first transaction committed to the db (actually don't know if this should be handled manually or geoserver will handle it itself)...

This is the lock feature request:

$.ajax('http://localhost:8080/geoserver/wfs', {
    type: 'POST',
    data: {
      service: 'WFS',
      version: '1.1.0',
      request: 'LockFeature',
      typename: 'mytable3',
      cql_filter: 'id=' + f.values_.id
    }
  });

And after this request Iam trying to update the feature using this request:

$.ajax('http://localhost:8080/geoserver/TOTO1/mytable3/wfs', {
  type: 'POST',
  dataType: 'xml',
  processData: false,
  contentType: 'text/xml',
  data: str,
}).done(function () {
  WFSsource.clear();
});

the update feature request without the lock works properly but when I use the lock the update feature request return with:

    <ows:ExceptionText>Update error: Transaction does not have authorization for mytable3:mytable3.5</ows:ExceptionText>
  • Welcome to GIS SE! As a new user, please be sure to take the short tour to learn about this site's focused Q&A format. – Andy Jan 23 at 17:37
  • 1
    it looks like the 2nd request is not using the transaction with the lock - but I've never bothered with locking as it is designed for updates which will take a long (>1h) time – Ian Turton Jan 24 at 9:18
  • Looks like your GeoServer user doesn't have permissions to execute a WFS transaction. Check your geoserver log to see the full error and provide it. – pavlos Jan 24 at 9:56
  • @IanTurton that's true the 2nd request is independent from the first one, but is there a place says that locking is designed for (>1h) long updates??and if not how the 2nd request should be?? – Ross Jan 24 at 15:58
  • @pavlos No I am able to execute insert, update, delete using WFS-t... – Ross Jan 24 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.