Hi all,

Trying to use the C# client available from https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23 to perform an update query, however I must be missing the obvious - query runs and no exceptions are raised, however the XML remains un-changed.  Code snippet (as this is held on a different machine):

String base_update_query = @"xquery version '3.0';
                let $invoice := db:open('{0}')/CommercialDocument[Customer/@id={1}]
                return replace value of node $invoice/InvoiceNumber with '{2}'";

....

Session session = new Session("localhost", 1984, "admin", "my_pass");

Query q = session.Query(
  String.Format(
    base_update_query,
    String.Concat("billing_run_", billing_run_id),  customer_id,  invoice_number
  )
);

....

From the BaseX logs I then see entries:

QUERY[1] xquery version '3.0'; let $invoice := db:open('billing_run_506')/CommercialDocument[Customer/@id=437] return replace value of node $invoice/InvoiceNumber with '28443'

so I know the query reached the server, and the response seems to be "not error" as no exception is being raised - however the XML document hasn't been updated.  Yet if I run the same query in either the client or web client it works (document updates) - provided I switch the query to "updating" not read-only.

Is there a flag I've missed, or is .Query of Session the wrong method to use

Kind regards

Chris Speare

 

The information contained in the email and any files transmitted with it is confidential and intended for the addressee only. If you have received this email in error please accept our apologies and notify the originator. Any disclosure, copying, distribution or any other use of this communication is strictly prohibited and may be unlawful. We reserve the right to monitor and intercept communications for lawful business purposes.

 

Wireless Innovation Ltd , Unit D2, Churcham Business Park, Churcham, Gloucestershire, GL2 8AX, Great Britain.

Company Registration Number 5240202, Place of Registration Companies House Cardiff.