I would tend to use as few queries as are practical. That gives the server a 
better opportunity to reuse memory, and should also reduce JVM memory 
utilization vs a multi-threaded, multi-query approach.

You might be able to extend XQSync's SessionWriter class to do this for you: 
https://github.com/marklogic/xqsync

-- Mike

On 14 Sep 2011, at 23:26 , Mahitha T U wrote:

> Hi ,
> I have an application, where a java application invokes an xquery(residing in 
> destination db) to copy document from one ML db to another ML db.
> The same document needs to be inserted to multiple location in the 
> destination db.  
> Shall we have Java application spawn multiple threads to invoke the xqy 
> (which will fetch doc from source db and insert to a single location)or  the 
> xquery file itself fetch the doc from source db and insert to multiple 
> locations sequentially or parallely using multiple threads .
> Which of these are the most memory efficient way to handle this? I would like 
> also know memory /chache is handled during document insertion.
> Regards,
> Mahita
> _______________________________________________
> 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