On Tue, 02 Jun 2009 09:34:43 -0700, Runstein, Robert E. (Contr) (IS)
<[email protected]> wrote:
Hi Danny,
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.
Bob
Yes, this is what a lot of the mechanics of CPF are for. As long as you
construct your CPF actions to the standard template so that they correctly
call cpf:success or cpf:failure, the properties on the document will be
sufficient for the restart to know exactly where to pick things up again.
It doesn't matter which pipeline document the transition rules happen to
be in: as long as the pipeline is attached to the domain, you will be fine.
Pipelines are not "executed" one after another: they just provide an
administrative unit for a collection of state transition rules.
I would recommend that you do put in place an error-handling pipeline
(I would recommend this generally, in fact) that does whatever you need.
I would strongly disrecommend using invoke/eval from within an action,
however, as the CPF guarantees of having the document consistent with
its state (as represented on the CPF properties) depend on the document
changes occurring in the same transaction as the CPF property updates
(which is why your actions must call cpf:success or cpf:failure).
//Mary
From: Danny Sokolsky <[email protected]>
Subject: [MarkLogic Dev General] RE: Updates within catch blocks
To: General Mark Logic Developer Discussion
<[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="us-ascii"
Hi Bob,
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?
-Danny
From: [email protected]
[mailto:[email protected]] On Behalf Of Runstein,
Robert E. (Contr) (IS)
Sent: Tuesday, June 02, 2009 8:15 AM
To: [email protected]
Subject: [MarkLogic Dev General] Updates within catch blocks
Hi,
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?
Thanks.
Bob Runstein
[email protected]
Principal Engineer
Mark Logic Corporation
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general