Hi,
I posted a question on the GIS StackExchange group :
http://gis.stackexchange.com/questions/99966/transactions-in-geoserver-wfs-is-it-possible-to-know-which-action-failed
.
I was told maybe I could get more informations by asking on this mailing list!
To resume the question :
I'm using Java to send queries to Geoserver using plain HTTP POST requests.
I have a bunch of actions (Insert, Update, Delete) that I need to be transactional. If one fails,
none should be commited.
Ideally, I'd like to be able to controle the transaction "externally" : To start a transaction, to
make multiple requests to the Geoserver (one request per action), then to commit or rollback the
transaction, by myself. Is it possible? I had a quick look at Geotools client and it seems to
provide such kind of external transaction control. How does it do it?
If controlling the transaction externally is not possible, I guess I have to wrap all the actions
that need to be transactional in a single <wfs:Transaction> element and send that in a single request.
For example :
------------------------------
|<wfs:Transaction service='WFS' version='1.0.0'
xmlns:wfs='http://www.opengis.net/wfs'
xmlns:gml='http://www.opengis.net/gml'
xmlns:ogc='http://www.opengis.net/ogc'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/wfs.xsd'>
<wfs:Insert>
[[FEATURE_TO_INSERT_1]]
</wfs:Insert>
<wfs:Insert>
[[FEATURE_TO_INSERT_2]]
</wfs:Insert>
<wfs:Insert>
[[FEATURE_TO_INSERT_3]]
</wfs:Insert>
</wfs:Transaction>|
------------------------------
That could be acceptable for my application. But the problem is GeoServer doesn't return enough
information when an error occures. For example, if the second Insert fails, here is the kind of
response Geoserver returns :
------------------------------
|<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
java.lang.RuntimeException: Parsing failed for DIAMETRE:
java.lang.NumberFormatException Parsing failed for DIAMETRE:
java.lang.NumberFormatException
null
</ServiceException>
</ServiceExceptionReport>|
------------------------------
From this response, I have no way to know which action (which "Insert") failed. And this is
something that is really problematic in my application...
Is there a way to send multiple actions in a transaction and to know which one
fails when it's the case?
Thanks in advance!
Julien
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users