Jakob, I'm curious: why separate transactions? When you first described
the use-case, I expected that you'd want all three steps in a single
transaction.
thanks,
-- Mike
On 2010-08-13 09:46, Jakob Fix wrote:
> Hi,
>
> I've created an xquery module called by a document-creation trigger
> that does the following:
>
> 1) copy the original document to another directory
> 2) remove the original document
> 3) add a property to the new document
>
> In order for this to work, I created a function for each task, and
> inside each function I did an xdmp:eval() to make sure that these
> actions are considered independent transactions. Can someone confirm
> that this is the right approach? Judging from the documentation and
> the fact that it works this seems ok, but I'm kind of hesitant to use
> eval() all over the place.
>
> Thanks,
> Jakob.
>
> Here's an example for the xdmp:document-insert wrapper function:
>
> declare function local:insert-document( $new-filename as xs:string,
> $doc as document-node() ) as item()*
> {
> xdmp:eval("
> xquery version '1.0-ml';
> declare variable $new-filename as xs:string external;
> declare variable $doc as document-node() external;
> xdmp:document-insert( $new-filename, $doc )
> ",
> (
> xs:QName("new-filename"), $new-filename,
> xs:QName("doc"), $doc
> )
> )
> };
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general