Ignacio

You could make use of the auditing feature - 
http://docs.marklogic.com/guide/admin/auditing#id_15948

MarkLogic can be configured to output an audit record when either 
document-insert or document-update occurs.

Ken


From: [email protected] 
[mailto:[email protected]] On Behalf Of Ignacio Tripodi
Sent: 15 September 2015 20:43
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Best way to detect mutating operations?

Thanks, Christopher, that's a good idea. The only problem with that approach is 
that I would have to track that at a specific code location (and I'm assuming 
it would be relative to the specific thread, not an process spawned by the 
given xqy script, right?).

Is there a general way to detect if "a document update just happened"? I could 
test this in a very controlled local environment to guarantee nothing else 
besides my request is going on.
Thanks,
-i

On Tue, Sep 15, 2015 at 1:35 PM, Christopher Hamlin 
<[email protected]<mailto:[email protected]>> wrote:


In situations such as these, I find it useful to log what is happening with an 
expression like

xdmp:log(fn:concat ("position #1: xact (", xdmp:transaction(), "), mode (", 
xdmp:get-transaction-mode(), "), ts (",xdmp:request-timestamp(),")")),

This will log the current transaction number, the transaction mode, and the 
request timestamp (or empty for query statements).



/ch

On Tue, Sep 15, 2015 at 3:31 PM, Ignacio Tripodi 
<[email protected]<mailto:[email protected]>> wrote:
Besides the obvious code analysis by simple inspection (which can prove less 
than simple on large, complex systems), is there a reliable way to tell if a 
request to MarkLogic produced an XQuery mutating operation anywhere during the 
lifetime of that request? I'm interested to analyze if a particular request 
would be causing a document update somewhere or not. I'm looking at lock rates 
in the monitoring charts, for example, but they're just rates and not linked to 
a particular request.
Thanks for any insight you could provide,
-i

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general


_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to