Try passing values from those sessions into XQuery module variables, that are defined as external. See https://docs.marklogic.com/javadoc/xcc/overview-summary.html under "Passing Variables With Queries". The examples use newAdhocQuery, but newModuleInvoke allows external variables too.
Also take a look at these code samples: https://github.com/marklogic/recordloader/blob/0fda9f2e2ca9eb9088bdc11f8d903164428628af/src/java/com/marklogic/recordloader/xcc/XccModuleContent.java#L152 https://github.com/marklogic/corb/blob/c7d92d6f26fcf475d244a4ce977bd113a1583d17/src/java/com/marklogic/developer/corb/Manager.java#L442 -- Mike > On 16 Feb 2015, at 22:01 , Prasanth N V R <[email protected]> wrote: > > Hi, > > We are making a XCC connection to ML DB from Java(invoking XQuery file). > > Is it possible to have any value defined in the XCC session, so that the > value added in the session could be used in XQuery file which is invoked via > the XCC call. > > We in-turn call series of functions defined in various XQuery files, so > instead of passing the values to all these files, is it possible to have a > value in the session and access wherever i need it. > > We tried using the session.setUserObject(). But we are not sure how to access > the session value in XQuery. > > Thanks, > Prasanth > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
