Hi,

do you mean something like a repo variable ?

If you define a module name in your repo:

 1-      module namespace myNs = 'http://www.xxxxx.fr/xxxx-repo’;

You can define in your repo a new variable :

 1-    declare variable $myNs:testid :=  db:open(‘xxxxx')/utilisateurs/entry/sessions/session/id=session:id();

Then import your module in your restxq:

  1-   import module namespace isi = 'http://www.isilex.fr/isi-repo’;

And access your variables: 

  1-    $myNs:testid

More here: http://docs.basex.org/wiki/XQuery_3.0#External_Variables

Sorry If I’m wrong and didn’t understand,

XLS
Le 5 sept. 2017 à 01:37, Erik Peterson <ep@ardec.com> a écrit :

How can I create a variable that is evaluated only once but accessed across many RestXQ requests and sessions. I'm trying to cache data that comes from an integration with an expensive operation. Does BaseX support something similar to server variables like Mark Logic?