Hi,

Found a solution for this issue, that is to execute the filtering for each 
document in a separate transaction by using xdmp:eval().
Then the <error> is returned for only issue files and for other files proper 
xhtml is returned.

for $e in ("/A.pdf","/B.pdf","/C.pdf","/D.pdf")
let $p := xdmp:eval(
                    'xquery version "1.0-ml";
                    declare variable $e as xs:string external;
                    let $p := try {xdmp:set-transaction-mode("query"), 
xdmp:set-transaction-time-limit(50), xdmp:document-filter(doc($e)), 
xdmp:commit()  }
                                            catch ($exception) 
{<error>{$exception//error:message//text()}</error>}
                   return $p',
                   (xs:QName('e'), $e))
return $p

Thanks,
Rushabh Mehta
Call:(W) +91 40 66674084
________________________________
From: Metha, Rushabh
Sent: Wednesday, September 04, 2013 7:30 PM
To: [email protected]
Subject: RE: Set-transaction-time-limit

Hi,

Can somebody please advise for this issue.

Thanks,
Rushabh Mehta
Call:(W) +91 40 66674084
________________________________
From: Metha, Rushabh
Sent: Saturday, August 31, 2013 5:33 PM
To: [email protected]
Subject: Set-transaction-time-limit


Hi,

I am trying to perform xdmp:document-filter on a pdf file list. In this list 
there are some pdf which were not-giving any result for xdmp:document-filter 
and made the query max time out.

So I decided to use limit the time on document-filter operation as follows, 
where by limiting the time to 50 seconds and in time out returning an error.
But whenever its encountering Time-out for a file its giving back the <error> 
and for the next pdf's in list the same error is received though those files 
are working properly with a document-filter(when tested alone)

xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";;

for $e in ("/A.pdf","/B.pdf","/C.pdf","/D.pdf")
let $p :=  (
try {xdmp:set-transaction-mode("query"), xdmp:set-transaction-time-limit(50), 
xdmp:document-filter(doc($e)), xdmp:commit()  }
    catch ($exception) {<error">{$exception//error:message//text()}</error> })
return $p

For example in the list of file A,B,C,D. B.pdf is the file which takes a long 
time during document-filter rest A,C and D give proper results with 
document-filter.
But when below code is run I get results for only A.pdf where as for B,C and D 
<error> is returned.

If I change the order of files in list as A,C,B,D the  i get results for A and 
C but B and D return <error>

Please advise if I am missing something.

Thanks,
Rushabh Mehta
Call:(W) +91 40 66674084

----------------------------------------------------------------------
This message w/attachments (message) is intended solely for the use of the 
intended recipient(s) and may contain information that is privileged, 
confidential or proprietary.  If you are not an intended recipient, please 
notify the sender, and then please delete and destroy all copies and 
attachments, and be advised that any review or dissemination of, or the taking 
of any action in reliance on, the information contained in or attached to this 
message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a 
solicitation of any investment products or other financial product or service, 
an official confirmation of any transaction, or an official statement of 
Sender.  Subject to applicable law, Sender may intercept, monitor, review and 
retain e-communications (EC) traveling through its networks/systems and may 
produce any such EC to regulators, law enforcement, in litigation and as 
required by law. 
The laws of the country of each sender/recipient may impact the handling of EC, 
and EC may be archived, supervised and produced in countries other than the 
country in which you are located. This message cannot be guaranteed to be 
secure or free of errors or viruses.  Attachments that are part of this EC may 
have additional important disclosures and disclaimers, which you should read.   
By messaging with Sender you consent to the foregoing.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to