Author |
Message |
10/06/2010 07:28:30
|
efferson
neo
Joined: 10/06/2010 07:14:32
Messages: 3
Location: Novosibirsk
Offline
|
Can I remove all elements of cache whose keys begin with the specified prefix?
For example I have 2 functions: first
Code:
public String doA(Integer userId, String someValue)
that I want to cache (with cache key "doA:" + userId + ":" + someValue), and second
Code:
public String doB(Integer userId)
that should drops cache of function "doA" for current userId (cache keys started with "doA:" + userId + ":").
I found that I can solve my problem using "getKeys*" functions and iterating over all keys searching for matches... but I thing it is wrong solution :(
|
|
|
10/06/2010 14:52:26
|
gluck
qaestor
Joined: 09/15/2009 18:01:23
Messages: 179
Location: Brisbane, Australia
Offline
|
Not at the moment.
But we are adding search to ehcache. It will let you do a regular expression search.
Look for the beta in November.
|
|
|
10/06/2010 22:22:37
|
efferson
neo
Joined: 10/06/2010 07:14:32
Messages: 3
Location: Novosibirsk
Offline
|
Are you going to add support for cache tags?
For example, method "put" will have third parameter String[] with names of tags. When we want to invalidate all caches tagged by certain tag we will call method "resetTag(String name)". Nice, isn't it?
Of course, I can write some util classes that provide this functional. But I think that it will look more correctly as part of standard functional.
|
|
|
10/06/2010 22:35:24
|
gluck
qaestor
Joined: 09/15/2009 18:01:23
Messages: 179
Location: Brisbane, Australia
Offline
|
Efferson
The tag idea we call groups. It got done last year but has not been merged in. I am hoping to do that soon.
|
|
|
10/07/2010 18:56:29
|
efferson
neo
Joined: 10/06/2010 07:14:32
Messages: 3
Location: Novosibirsk
Offline
|
Please, do it :)
|
|
|
11/08/2010 15:01:52
|
gluck
qaestor
Joined: 09/15/2009 18:01:23
Messages: 179
Location: Brisbane, Australia
Offline
|
Hi, the Ehcache Search is now out in alpha. You can give it a go. See http://ehcache.org/documentation/search.html
|
|
|
07/21/2011 00:01:50
|
rajoshi
seraphim
Joined: 07/04/2011 04:36:10
Messages: 1491
Offline
|
Issue seems to be resolved.Please let us know if more information is required.
|
Rakesh Joshi
Senior Consultant
Terracotta. |
|
|
02/14/2013 02:04:55
|
vyasmind
neo
Joined: 02/08/2012 21:23:39
Messages: 1
Location: Hyderabad
Offline
|
Please point me to the sample code or code snippet to understand the implementation.
|
Manish Vyas |
|
|
|