[MarkLogic Dev General] How to configure a CPF when deleting
mary.holstege at marklogic.com
Thu Apr 23 08:43:24 PDT 2009
On Thu, 23 Apr 2009 07:42:44 -0700, Tim Meagher <tim at aaom.net> wrote:
> Hi Mary,
> Thanks for the explanation - I'll give this a shot. I'm assuming I can
> make the change in the same pipeline...
> I also appreciate the info about the links, however I don't think I can
> the link because the linked document would be in another database. I
> the secondary doc in different databases because they use different
> and it avoids problems with setting different fragment roots and range
> indexes on similarly named elements.
> So when I create or update the document, the pipeline calls a program
> runs an xquery to transform the incoming doc into a new format and
> or updates the results into the secondary database via an xdmp:invoke
> function call - nasty but necessary... Likewise when I delete the
> it has to delete the document in the secondary database as well via an
> xdmp:invoke function call.
> If there's a better way to approach this I'm all ears...
I would just warn you that using xdmp:invoke that performs updates
in the context of CPF actions is definitely travelling off-reservation.
Since CPF state management depends on having the property updates
happen in the same transaction as the action, having some of that
work done separately can potentially leave you with an inconsistent
view if, say, lightning strikes the data center after the invoked call
commits but before the main one does. That said, in the case of
delete, I think you can get away with it, or you can take an educated
gamble about the risk of lightning at the sensitive moment.
Mary.Holstege at marklogic.com
Mark Logic Corporation
More information about the General