9 Replies Latest reply on Feb 27, 2007 11:38 AM by Seto Kaiba

    About the new chapter Caching in documentation.

    Seto Kaiba Expert

      I read the 18.1 chapter . And I don't understand.
      I think the example maybe should be changed as below.
      @Name("chatroom")
      public class Chatroom {
      @In PojoCache pojoCache;

      public void join(String username) {
      try
      {
      Set userList = (Set) pojoCache.get("chatroom", "userList");
      if (userList==null)
      {
      userList = new HashSet();
      }
      userList.add(username);
      pojoCache.put("chatroom", "userList", userList);
      }
      catch (CacheException ce)
      {
      throw new RuntimeException(ce);
      }
      }
      }