For the purposes of the list.
Begin forwarded message:
From: Charles Foster Subject: Re: Client Side transactions Date: 12 December 2013 20:47:36 GMT To: rajeshwar.kamineni@neustar.biz
Hi Raj,
BaseX doesn't support client side transactions, but does support ACID transactions within the context of 1 query, i.e. all updates / inserts / deletes within the context of one query will either succeed or fail [1].
To update a document in place, you can always use XQuery Update Facility [2], or you could overwrite the document by re-inserting it with BaseX XQJ.
In BaseX XQJ 1.2.x, performing an insert with a URI which already exists in the Database will create duplicate fragments (not good), so you would have to delete the previous document first prior to inserting. As of BaseX XQJ 1.3.x which is scheduled to be released soon, you won't need to worry about any of that.
Just to help you along, the source code for the XQJ2 interfaces can be found here:
https://github.com/cfoster/xqj2/
Which includes the insertItem [3] method.
Kind Regards,
Charles
[1] http://docs.basex.org/wiki/Transaction_Management [2] http://docs.basex.org/wiki/XQuery_Update [3] https://github.com/cfoster/xqj2/blob/master/src/main/java/com/xqj2/XQConnect...
On 12 Dec 2013, at 20:10, rajeshwar.kamineni@neustar.biz wrote:
Raj Kamineni:
Hi
When using setAutoCommit(false) on a connection, I got Client Side transactions are not supported.
Any suggestions on alternative ways?
Also, I am looking for a way to update the entire document in basex using XQJ
xqc = baseXRepository.getConnection(); XQItem item = xqc.createItemFromDocument(policyDoc,null,null); xqc.insertItem(policy.getPolicyId(),item, null);
How do I go about updating when I inserted a document using the above code.
Thanks Raj
basex-talk@mailman.uni-konstanz.de