Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Module Documentation Is Missing #34

Open
nsincaglia opened this issue Aug 9, 2019 · 8 comments
Open

Cache Module Documentation Is Missing #34

nsincaglia opened this issue Aug 9, 2019 · 8 comments
Labels

Comments

@nsincaglia
Copy link

Where is the problem

eXist-db's XQuery Function Library documentation does not include the Cache module's functions.

What is the problem

The following Cache module functions are missing from the documentation.
cache:cleanup($cache-name as xs:string)
cache:clear($cache-name as xs:string)
cache:clear()
cache:create($cache-name as xs:string, $config as map())
cache:destroy($cache-name as xs:string)
cache:get($cache-name as xs:string, $key as xs:anyType+)
cache:keys($cache-name as xs:string)
cache:list($cache-name as xs:string, $keys as xs:anyType
)
cache:names()
cache:put($cache-name as xs:string, $key as xs:anyType+, $value as item()*)
cache:remove($cache-name as xs:string, $key as xs:anyType+)

@duncdrum duncdrum transferred this issue from eXist-db/documentation Aug 9, 2019
@karkraeg
Copy link

karkraeg commented Sep 5, 2019

How do those commands work? I’m on eXist 4.5.0 and I get an invalid qname when evaluating. Do I have to import module namespace cache="http://exist-db.org/xquery/cache"; or something like this? Documentation/Information on this would be greatly appreciated!

Thanks

@adamretter
Copy link
Member

Yes you need to import the module first.

@karkraeg
Copy link

karkraeg commented Sep 5, 2019

Evaluating

xquery version "3.1";
import module namespace cache="http://exist-db.org/xquery/cache";
cache:names()

I get the following error:

Cannot compile xquery: err:XQST0059 error found while loading module cache: failed to load module: 'http://exist-db.org/xquery/cache' from: 'http://exist-db.org/xquery/cache', location: 'http://exist-db.org/xquery/cache'. Source not found. 

@adamretter
Copy link
Member

@karbecker Ah, you will also need to uncomment the following line in your conf.xml and restart it:

<module uri="http://exist-db.org/xquery/cache" class="org.exist.xquery.modules.cache.CacheModule" />

@karkraeg
Copy link

karkraeg commented Sep 5, 2019

Thanks! Now, those cache commands don’t interact with the Cache usage shown by Monex, do they?

Screenshot of Monex

I was hoping to be able to clear the exist cache on demand as we are experiencing some performance issues we believe are connected to the cache being overfull...

@adamretter
Copy link
Member

adamretter commented Sep 5, 2019

@karbecker Ah! No they are completely different types of Cache. The Cache module is just a simple wrapper around a HashMap for use from XQuery for caching things the user might interested in for their own application needs.

@karkraeg
Copy link

karkraeg commented Sep 6, 2019

Ah okay, thanks for clarifying. While we’re at this, even though it probably doesn't belong in this Github Issue: Is there any option to clear/purge the main eXist cache?

Thanks!

@adamretter
Copy link
Member

adamretter commented Sep 6, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants