Damon,
Just wondering. MarkLogic 5 has transaction management functions. Would things be different if one would use those? E.g. set the mode to update and do a commit after the insert? Would that make such exceptions catchable from within the xquery code? (I also noticed a minor thing in the docs. The example of set-transaction-mode returns “update”, but according to the description I was expecting “query”: http://developer.marklogic.com/pubs/5.0/apidocs/TransactionBuiltins.html#xdmp:set-transaction-mode ) Kind regards, Geert *Van:* [email protected] [mailto:general-bounces@de veloper.marklogic.com] *Namens *Damon Feldman *Verzonden:* woensdag 14 december 2011 14:56 *Aan:* General MarkLogic Developer Discussion *Onderwerp:* Re: [MarkLogic Dev General] CORB processing continuation query. Sachin, That is correct. The indexing happens during the transaction commit, not during XQuery processing, so your try/catch block cannot catch the error. Your best bet is to fix the problem directly (by not inserting invalid numbers in fields that are indexed as xs:float, including not adding empty string contents or empty elements that are indexed as xs:float. Yours, Damon *From:* [email protected] [mailto: [email protected]] *On Behalf Of *sachin gill *Sent:* Wednesday, December 14, 2011 4:02 AM *To:* General MarkLogic Developer Discussion *Subject:* Re: [MarkLogic Dev General] CORB processing continuation query. HI , Srry for replying so late. I m still not able to catch this xquery exception in my CORB module.The errors are not catchable.I m try to catch it as mentioned below: my sample try block : let $err := try { au:put($new-request,()) } catch ($err) { xdmp:log($err) } com.marklogic.xcc.exceptions.XQueryException: XDMP-RANGEINDEX: Range index error: float fn:doc("/root/assets/173-cfa-study-session-17/173-cfa-study-session-17.xml")/asset/*:metadata/*:price: XDMP-CAST: (err:FORG0001) Invalid cast: xs:untypedAtomic("") cast as xs:float in /assets/corb-pipeline.xqy at com.marklogic .xcc.impl.handlers.ServerExceptionHandler.handleResponse(ServerExceptionHandler.java:30) at com.marklogic .xcc.impl.handlers.EvalRequestController.serverDialog(EvalRequestController.java:72) at com.marklogic .xcc.impl.handlers.AbstractRequestController.runRequest(AbstractRequestController.java:76) at com.marklogic.xcc.impl.SessionImpl.submitRequest(SessionImpl.java:261) at com.marklogic.developer.corb.Transform.call(Transform.java:68) at com.marklogic.developer.corb.Transform.call(Transform.java:1) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Any help will be highly appreciated. thanks, Sachin On Tue, Nov 29, 2011 at 8:58 AM, Damon Feldman <[email protected]> wrote: Sachin, Perhaps this was already mentioned, but your error isn't due to corrupt XML, exactly, but is because you have a float range index on the <price>, and your CoRB script adds an empty <price/> element. Empty values coerce to valid strings, but not valid floats. If you change your transform, you may find CoRB runs without error, or at least that all errors are caught by a try/catch. Yours, Damon ------------------------------ *From:* [email protected] [ [email protected]] On Behalf Of sachin gill [ [email protected]] *Sent:* Monday, November 28, 2011 10:30 AM *To:* General MarkLogic Developer Discussion *Subject:* Re: [MarkLogic Dev General] CORB processing continuation query. Yeah Michael , I realized it after replying. When I try to parse a corrupt XML it throws below exception and shuts down CORB. com.marklogic.xcc.exceptions.XQueryException: XDMP-RANGEINDEX: Range index error: float fn:doc("/root/assets/173-cfa-study-session-17/173-cfa-study-session-17.xml")/asset/*:metadata/*:price: XDMP-CAST: (err:FORG0001) Invalid cast: xs:untypedAtomic("") cast as xs:float in /assets/corb-pipeline.xqy at com.marklogic.xcc.impl.handlers.ServerExceptionHandler.handleResponse(ServerExceptionHandler.java:30) at com.marklogic.xcc.impl.handlers.EvalRequestController.serverDialog(EvalRequestController.java:72) at com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(AbstractRequestController.java:76) at com.marklogic.xcc.impl.SessionImpl.submitRequest(SessionImpl.java:261) at com.marklogic.developer.corb.Transform.call(Transform.java:68) at com.marklogic.developer.corb.Transform.call(Transform.java:1) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Nov 28, 2011 2:28:14 AM com.marklogic.developer.corb.Manager stop I have one more query, does CORB also have time out issue over network, as we are facing abrupt stopping of CORB too when our fetched url are too large. Thanks Sachin On Mon, Nov 28, 2011 at 8:49 PM, Michael Blakeley <[email protected]> wrote: I think John was suggesting an XQuery try-catch expression, not a Java one. But you are more likely to get helpful suggestions if you post a full example of the exception you are trying to avoid. Corb throws some fatal exceptions of its own, when it cannot reasonably continue. It also re-throws various MarkLogic and XQuery exceptions. Seeing the exception that you are hitting would help. -- Mike On 28 Nov 2011, at 07:11 , sachin gill wrote: > HI John, > thanx for the suggestion but I'm using CORB jar (so that if any version version upgrade happen we don;t need to do lot of customisation) rather than its code , so can't handle it inside CORB code . > > Thanks > Sachin > > On Mon, Nov 28, 2011 at 6:50 PM, John Zhong <[email protected]> wrote: > First idea is that you can use try/catch. For example: > > try { > (: your business code here :) > } catch($e) { > (: your code to handle exception :) > } > > John > > On Mon, Nov 28, 2011 at 6:41 PM, sachin gill <[email protected]> wrote: > Hi , > We are facing bulk processing issue with CORB .We are using it to process a large set of XML's , it works fine till it doesn't get any issues or exception.Once it finds any exception it stops,And we need to start from scratch again. > > How can i ignore such exception while processing and continue for other xmls . > > Thanks > Sachin > > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > > > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
