1 Reply Latest reply on May 27, 2011 10:54 AM by galder.zamarreno

    question on using Infinispan on jboss as 4.2.3

    jatwood

      I am trying to use Infinispan for a simple case of sharing cache data across servlet contexts.

       

      Basically the outline of the application is one servlet container loads data into jaxb class structure then puts that into the default cache using the session ID as key.  Other applications can then get the data out modifiy it, etc...

       

      I am able to load the data in under JSP

      ...

      sessionid = session.getId();

      EmbeddedCacheManager manager = new DefaultCacheManager();

      // configure your config bean accordingly

      Cache<String, User> customCache = manager.getCache();

      customCache.put(sessionid, myUser);

      assert customCache.containsKey(sessionid);

      ...

       

      but when I try to retireve it under a different servlet I am getting a null object

       

      ...

      EmbeddedCacheManager manager = new DefaultCacheManager();

      // configure your config bean accordingly

      Cache<String, User> customCache = manager.getCache();

      User myUser = customCache.get(sessionid);

      ...

       

      It's probably somehting simple I am missing, but I thought I would ask.

       

      Thanks for your help!