If you mean that your function appears to never run at all, it may be because
it never runs.  When a function call mysteriously never runs, even though you
know the call to it was reached, this is usually a side-effect of function 
mapping.

   If you declare a function argument that is typed as a singleton (one and only
one value allowed) and you pass a sequence to that function, then the function
is invoked once for each item in the sequence.  If the sequence is empty, it has
zero items and so the function is invoked zero times.

   For example:

declare function foo ($blah as xs:string)
{
    fn:concat ("Hello ", $blah)
};

foo (())

   In this code, the function foo() will never run.

   You can test this by disabling function mapping in your module by declaring
the following option in the prolog of your module.  With this, passing a null 
pointer
will result in an exception in your code.

declare option xdmp:mapping "false";

   Hope that helps.

---
Ron Hitchens {[email protected]}  +44 7879 358212

On Sep 20, 2013, at 10:17 AM, [email protected] wrote:

> Hi All,
>  
>                 I was trying to do profiling for one of my function in my 
> xquery module.
>  
> Both profile button in CQ/Query Console , prof:report() function is not 
> generating the profile report for that function. It is hanged up, I tried 
> multiple times, and it didn’t work out.
>  
> But profiling is working and generating report for other functions / adhoc 
> query.
>  
> Note: The function which I am trying to profile has multiple internal calls 
> to other module functions and there are multiple recursive function calls.
>  
> Please suggest what could be the reason?
>  
> When I tried xdmp:query-meter(), xdmp:elapsed-time(), they are working and 
> giving  “PT20.319355S” timings.
>  
> Thanks & Regards,
> Santhosh Rajasekaran,
> This e-mail and any files transmitted with it are for the sole use of the 
> intended recipient(s) and may contain confidential and privileged 
> information. If you are not the intended recipient(s), please reply to the 
> sender and destroy all copies of the original message. Any unauthorized 
> review, use, disclosure, dissemination, forwarding, printing or copying of 
> this email, and/or any action taken in reliance on the contents of this 
> e-mail is strictly prohibited and may be unlawful. 
> _______________________________________________
> 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