[MarkLogic Dev General] Transaction hangs db

Michael Blakeley mike at blakeley.com
Fri Aug 31 08:48:00 PDT 2012

What version of the server are you using?

That semicolon after the node-replace acts just like a commit, so the explicit xdmp:commit is probably trying to commit an empty update statement. That extra, empty commit seems to be harmless with cq and 5.0-3.3, but your environment may be different. Try something more like the docs example for xdmp:commit, with a commas rather than a semicolons:

xdmp:document-insert("/docs/mydoc.xml", <myData/>),

It might be better to learn how to update MarkLogic documents without using semicolons or xmdp:commit, before jumping into those advanced features. Mostly they aren't necessary, and they add extra complexity.

-- Mike

On 31 Aug 2012, at 01:07 , Henrik Thiil Nielsen wrote:

> Dear list members,
> I get strange behavior from the server when I run the following  simple
> transaction:
> declare option xdmp:transaction-mode "update";
> xdmp:node-replace(doc("sources_a.xml")/src:sources/src:originator[src:origin
> atorid="Abrahams_Aleck"]/src:surname, <src:surname>{ "TEST1"
> }</src:surname>);
> xdmp:commit();
> After this is executed, <surname /> has been updated to "TEST1" but no
> statement that I put after the above (before the commit or in a transaction
> of its own) executes.   When I try reloading the document from file into the
> database in Query Console, the console hangs and I have to restart
> MarkLogic. The document "sources_a.xml" is a quite small one of about 100k.
> As I am still a rookie I suspect I am doing something wrong though what I am
> doing doesn't look much different from the examples in the Application
> Developer's Guide. 
> Any help would be much appreciated.
> Henrik Thiil Nielsen
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

More information about the General mailing list