Andreas

I don’t believe xdmp:forest-clear is a transactional operator. It’s effectively 
a disk level operation that removes content from directories and replaces with 
re-initialized content. It’s generally used to reset databases by admin 
scripts, or from the Console.

So you shouldn’t really expect it to work in the way you’re expecting it to 
work. Your description of it as asynchronous is another accurate way of looking 
at it.

Ken Tune


From: [email protected] 
[mailto:[email protected]] On Behalf Of Andreas Hubmer
Sent: 02 October 2015 16:36
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] xdmp:forest-clear

Hello,

I've found an issue with xdmp:forest-clear.

xdmp:document-insert("test.xml", <root/>);
xdmp:forest-clear(xdmp:database-forests(xdmp:database()));
doc("test.xml") (: should be empty :)

When executing the above multi statement transaction, I would expect an empty 
result. But instead <root/> is returned.
When I execute doc("test.xml") manually some moments later, the expected empty 
result is returned.

As a workaround I could use xdmp:document-delete(cts:uris()) but my assumption 
is that xdmp:forest-clear is much faster. Is that true?

Is xdmp:forest-clear somehow asynchronous?
Or is it maybe a visibility problem with deleted data? I run the code as admin 
user (just for testing).

Regards,
Andreas

--
Andreas Hubmer
IT Consultant

EBCONT enterprise technologies GmbH
Millennium Tower
Handelskai 94-96
A-1200 Vienna

Web: http://www.ebcont.com

OUR TEAM IS YOUR SUCCESS

UID-Nr. ATU68135644
HG St.Pölten - FN 399978 d
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to