[MarkLogic Dev General] RE: Updates within catch blocks
Runstein, Robert E. (Contr) (IS)
Robert.Runstein at ngc.com
Tue Jun 2 09:34:43 PDT 2009
Yes, I am using CPF with the Status Change Handling pipeline. The
logging is not sufficient for my requirements. I need to write the
erroneous document to a special collection that holds erroneous
documents for later investigation of the reason for failure then
correction and re-ingest. I can put this write into a separate pipeline
called when the document goes into the specified failure state if I'm
guaranteed that the separate pipeline will always be called, even if the
power goes off and is then restored.
From: Danny Sokolsky <Danny.Sokolsky at marklogic.com>
Subject: [MarkLogic Dev General] RE: Updates within catch blocks
To: General Mark Logic Developer Discussion
<general at developer.marklogic.com>
<C9924D15B04672479B089F7D55FFC1322570BF02 at EXCHG-BE.marklogic.com>
Content-Type: text/plain; charset="us-ascii"
Are you use CPF here with the Status Change Handling pipeline? I think
it takes care of logging errors with the on-failure action, and logs the
errors to the properties and to the ErrorLog.txt file if it cannot write
to the document. Is that not sufficient for what you are trying to do?
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Runstein,
Robert E. (Contr) (IS)
Sent: Tuesday, June 02, 2009 8:15 AM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] Updates within catch blocks
I want to catch an exception, then insert a document representing the
failure then rethrow the original exception. The xdmp:rethrow() appears
to cause the insert to get rolled back. I have tried wrapping the
xdmp:document-insert call in xdmp:invoke with isolation set to
different-transaction, but the insert still does not persist. The
module is called from a pipeline, so it is important that I report the
failure condition. While I could do the insert in a following pipeline
triggered by the failure, I am concerned that there might be a
circumstance under which the following pipeline might not get executed
and the insert would never take place.
Is there a way to persist the insert within the catch block? Am I being
overly paranoid in worrying that the insert would never take place if
done in a following pipeline?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General