Using CPF, you could create a pipeline (instead of a spawned task) to perform 
the copy/verification/notification.   

The "created" state could be directed to the "copy" step.  The "copy" step 
could then be directed to a verification/notification step.

The background processes are not persistent between MarkLogic restarts where as 
CPF transactions are guaranteed.  Hence,  if you spawn a large number of jobs 
in the background and MarkLogic restarts, those jobs will be lost.     


Brad Rix
Senior Developer
+1 (303) 542-2172  |  Office
+1 (303) 915-2771  |  Mobile
[email protected]
http://www.flatironssolutions.com
IM:   AIM:   BradRix   MSN:  [email protected]



-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Vedavalli Radhika
Sent: Wednesday, March 23, 2011 2:20 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] How to track/test a spawned process?

Hi,

Using xquery, I am copying few documents from a folder to another.
This module performing the copy operation is spawned, so that
asynchronous mode of copying can be made. In case of higher number of
documents, we cannot wait for the copy process to complete and then
send back a response.

My requirement is to test and assert if the copying was successful.
Problem is we do not have any control on the processing once it is
spawned (or placed in the task queue).

1. A time-delay can be introduced and then the results of copying can
be verified.But how long should I wait cannot be defined, as one
server may respond sooner while other may take some more time based on
the how busy the server is.

2. Logs can be introduced in the xquery at the end of all processing.
However ErrorLog.txt will be rapidly growing and as well a rolling
file in our application. Monitoring the same will become a overhead.

Is there any way to monitor this thread? So that successful execution
or failure of the process can be tracked and then verifying the
results of the operation is a easy job.
Or is there any way to test a spawned process in an optimized way?

Thanks,
Radhika
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to