7 Replies Latest reply on Nov 17, 2005 7:03 PM by Ben Wang

    JBossCacheAOP synchronization of local variables

    mikeg123 Newbie

      I'm using JBossCacheAOP with JBoss 3.2.6

      I have defined the following maps in my class

      private Map localSessionMap = new HashMap ();
      private Map proxySessionMap;

      then I added the "localSessionMap" to the cache and retrieve the proxy referene:

      treeCache = new TreeCacheAop();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(treeCache, "META-INF/nmsSync-service.xml");

      treeCache.start(); // kick start the cache
      treeCache.putObject(cacheNodeName, this.localSessionMap);

      //get a proxied map
      proxySessionMap= (HashMap)treeCache.getObject(cacheNodeName);

      now when I try to add something to the proxy map "proxySessionMap"
      proxySessionMap.put(sessionId, sessDO);

      it adds the to the cache, but localSessionMap state is not synchronized
      Please help.