[ 
https://issues.apache.org/jira/browse/JCS-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672714#action_12672714
 ] 

Aaron Smuts commented on JCS-47:
--------------------------------

I'll update the docs.   The colon is the only special character.  You can use 
it for partial key removal.  You can use it in a key, but not at the end.

You should use as small of a key as possible to save on memory.  

I almost never use object keys.  Why bother?  Simple strings are easy to work 
with.

With the latest builds, there is a new API method called getMatching( String 
pattern ).  This will return all objects in the regions with a matching key.  
You have to use string keys to take advantage of this method.  

Aaron

> How to build an element key
> ---------------------------
>
>                 Key: JCS-47
>                 URL: https://issues.apache.org/jira/browse/JCS-47
>             Project: JCS
>          Issue Type: Question
>          Components: Documentation
>    Affects Versions: jcs-1.3
>            Reporter: Ronny Roeller
>            Assignee: Aaron Smuts
>
> I use a string as key for my elements. Now I was surprised to get this error 
> message:
> 11:07:52,257 INFO  [CacheEventQueue] Cache event queue created: 
> CacheEventQueue [listenerId=1501085802, cacheName=cache]
> 11:07:53,000 INFO  [STDOUT] org.apache.jcs.access.exception.CacheException: 
> key must not end with : for a put operation
> I guess this means that colon is a special character, and can't be freely 
> used as a key.
> Unfortunately, I couldn't find any documentation on the project website what 
> the constrains are for keys. It would also be interested to know if there is 
> anything else to be considered when choosing the key, e.g. is there an 
> advantage in using shorter keys?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jcs-dev-h...@jakarta.apache.org

Reply via email to