Since Geoserver won't use the "handles" for some types of errors, is there a way to do prior validation before sending the request to GeoServer, so those errors can be managed "per action"? What kind of errors will prevent GeoServer to use the handles? Only those occuring when the attributes are of a wrong type?

Thank you both fo your answers.

Julien




On 6/5/2014 7:29 PM, Jody Garnett wrote:
Andrea nailed it, transactions work as a single request. You can use "handles" as a note to yourself on what was being performed.

One last thing that gets missed is that transaction can work against more than one data source in a single go.

Finally if you have more then one editor you can start to look at "locking" the data you want to work with, and then referring the lock during your transaction.

Jody Garnett


On Thu, Jun 5, 2014 at 11:33 PM, electrotype <[email protected] <mailto:[email protected]>> wrote:

    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";  <http://www.opengis.net/ogc>
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";  
<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";  
<http://www.opengis.net/ogchttp://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] 
<mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/geoserver-users



------------------------------------------------------------------------------
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

Reply via email to