How to get baseCache from Dynacache with DistributedMap - Websphere

This is a discussion on How to get baseCache from Dynacache with DistributedMap - Websphere ; Hi, I am trying to get the 'baseCache' from dynacache with the DistributedMap class(from package com.ibm.websphere.cache) According to the javadoc this should be possible with code similiar to: {code} InitialContext ic = new InitialContext(); DistributedMap dm =(DistributedMap)ic.lookup("services/cache/instance_one"); {code} and I ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How to get baseCache from Dynacache with DistributedMap

  1. How to get baseCache from Dynacache with DistributedMap

    Hi,
    I am trying to get the 'baseCache' from dynacache with the DistributedMap class(from package com.ibm.websphere.cache)

    According to the javadoc this should be possible with code similiar to:
    {code}
    InitialContext ic = new InitialContext();
    DistributedMap dm =(DistributedMap)ic.lookup("services/cache/instance_one");
    {code}
    and I have managed to get various caches with this method (for example services/cache/iwk/global ) but never the 'baseCache'

    So far the only way I have managed to get the baseCache is by using the deprecated Cache and ServerCache classes from com.ibm.ws.cache, but would preferably not use these deprecated classes.

    So if anyone could point me in the right direction it would be greatly appreciated I'm doing this on portal 6.0.1.6

  2. Re: How to get baseCache from Dynacache with DistributedMap

    Good afternoon,
    I am assuming your looking for the jndi name.

    JNDI name of default cache or basecache is ‚Äúservices/cache/distributedmap‚ÄĚ...

    DistributedMap dm =(DistributedMap)ic.lookup("services/cache/distributedmap");

    Is this what your looking for?

  3. Re: How to get baseCache from Dynacache with DistributedMap

    I tried your suggestion and the cache that I got is the 'default' cache.

    But you got me on the right track, and I soon found out that if you use,
    {code}
    DistributedMap dm =DynamicCacheAccessor.getDistributedMap();
    {code}

    you will get the 'baseCache'

    thanks a lot for the help!

+ Reply to Thread