2 Replies Latest reply on Nov 29, 2010 9:31 AM by Michal Szymanski

    How to use JBoss Cache

    Michal Szymanski Newbie

      Hi

      I'm new to Jboss Cache and I have few very basic questions. In our system we would like store information about tokens (used for authentcation of request) in Cache. Simply first external request will create token after uthentcaton  in cache and next requests will be validated against token (we wll check if given token exists in cache).

      First question is, should we create one node e.g. /tokens and put all tokens (key=token string, value=some accoutn info) to this node? I've found in documentation that

       

      "One purpose of grouping cache data into separate nodes is to minimize  transaction  locking interference, and increase concurrency.  So for example, when  multiple threads or  possibly distributed caches are acccessing different accounts  simultaneously."

       

      Should we create our tokens between different nodes to reduce problem with concurrency? How many nodes we should create? We expect that we wll have about few thousend of token in cache in peak hours.

       

      Second questions is if we get object from cache (using get() method) can we change values of object not related to key? Do we get copy of object or reference. in documentation is information:

       

      The  data access methods are similar to the collections Map interface,  but some are read-only or return copies of the underlying the data'

       

      but I could not found what 'some' methods, there is no info about 'get' method.

       

      Michal Szymanski

      http://blog.szymanskich.net

      http://techblog.freeconet.pl