I am using ehCache to store larges amount of data.
This cache is accessed about 3 times every second and must be kept up to date.
I have a thread that runs which ... |
I have 2 different webapps (package into different war files) which needs to share some data via a cache (ehcache). I want to test out this idea with you to see ... |
Is there a way to disable ehache externally using a property file?
CacheManager.shutdown() doesnt seem to work?
Actually we have 2 app with the same source code i require ehcache in one and ... |
I have an application that uses ehcache for cache (but I think this problem is framework-agnostic), with a method interceptor so basically if I mark my method for caching something like ... |
Let's say I start with a single CacheManager like this:
private static CacheManager manager = CacheManager.create();
When I call getCache or addCache do I need to synchronize on the ... |
Using Ehcache , after Java app works 2.5 days, I have this statistic
cacheHits: 31185262, approximate 131 per sec
cacheMisses: 4642979, approximate 19 per sec
evictedCount: ...
|
12:18:55,541 INFO [UpdateChecker] New update(s) found: 2.0.0 [http://ehcache.org/news.html]
How do I suppress ehcache checking for new update(s), this is happening while loading my j2ee application and when ehcache is getting initialized.
... |
|
It's not immediately obvious to me how to set EhCache to expire an entire cache nightly/at midnight. I can easily do this programmatically via a job of some sort, but ... |
We are using EHCache with CF 8 to cache stuff on a central server using a RESTful interface over HTTP. I am trying to cache a cfquery object to the cache ... |
Context
I am storing a java.util.List inside ehcache.
Key(String) --> List<UserDetail>
The ordered List contains a Top 10 ranking of my most active users.
Problem
Concurrent 3rd party clients might be requesting for this list.
I have ... |
The docs on ehache says:
timeToIdleSeconds: Sets the time to idle for an element before it expires.
i.e. The maximum amount of time between accesses before an element expires
timeToLiveSeconds: Sets the time to ...
|
I want to cache data in a java web application deployed on multiple instances. We are using spring 2.5.6. What is the easiest caching library to configure and use with spring? ... |
I switched from xml to programmatically cache creation and now I can't retrieve my cache by name.
Here's a code snippet that shows what I'm doing maybe you can spot an obvious ... |
I am in the process of rewriting a bottle neck in the code of the project I am on, and in doing so I am creating a top level item that ... |
I am planning to implement a cache solution into an existing web app. Nothing complicated: basically a concurrent map that supports overflowing to disk and automatic eviction. Clustering the cache could ... |
I have this configuration for ehCache:
<ehcache>
<defaultCache
name="defaut"
...
|
Oracle Coherence states that it is "JCache-compliant". How can I take my code written against JSR-107, specifically the ehcache-jcache jar, and run it against Oracle Coherence?
... |
How to cache rarely changed many-to-one entity in CF ORM, such as, userType where there are only < 10 types? I don't want the extra select to get the type ... |
EHCache allows for persistance of the cache, and it requires all objects that are being cached to be Serializable. The objects that are being serialized and written to the Disk ... |
I have some questions on "overflowToDisk" attribute of element?
1) I read at this URL that :
overflowToDisk sets whether element can overflow to disk when the memory store has ... |
[Avatar]
2010-09-23 18:20:41 IST
I have the following configuration for my ehcache.
<CacheManager dynamicConfig="true" monitoring="autodetect" name="CacheManager1"
updateCheck="true"> <diskStore path="java.io.tmpdir" /> <defaultCache
clearOnFlush="true" copyOnRead="false" copyOnWrite="false" diskAccessStripes="1"
diskExpiryThreadIntervalSeconds="5" diskPersistent="true" ...
|
I have 2 functions: first
public String doA(Integer userId, String someValue)
that I want to cache (taking into account parameters of function), and second
public String doB(Integer userId)
that should drops cache of function "doA" ... |
I want to cache the response to image requests. The images are the results of dynamic resizing of a larger image.
I am using ehcache already for some caching. I would like ... |
I know I can use ColdFusion cache APIs to clear data as such:
<cfset cacheName = "custom">
<cfset ids = cacheGetAllIds(cacheName)>
<cfset cacheRemove(arrayToList(ids), false, cacheName)>
But in practice retrieving all the ids (i.e. cacheGetAllIds()) to ... |
So here is the problem I am trying to solve - I have an Object with two integer fields that I want to cache
public class MyObject {
int x;
...
|
I've started working with EHCache as a transactional cache (XAResource) in a JTA UserTransaction and I'm seeing something which is a bit strange, at least in my mind, and I'd like ...
|
Hey I'm currently running ehcache with spring in tomcat. I have a couple webs servers running their own instance of ehcache which I want to now moved to a shared/distributed cache. ... |
I am using one product which use ehcache 1.4.1 and I want to monitor the cache managed by that application. I saw that Terecotta released the EhCache monitor recently but it ... |
I am using the EhCache's decorator SelfPopulatingCache and have an issue when the cache tries to load a new entry, but it's non-existent (i.e. it doesn't exist in the database). ... |
I'd like to use JGroups replication w/ EHCache and also share the communication channel with my own app. What's the recommended way to do this? (Similar to JBoss's "shared transport" feature) ... |
I have a large java application that is configured to use JPA and Hibernate. It is also supposedly configured to use ehcaching for both entity and query caching. However, ... |
Could you please give me the steps to implement SelfPouplatingEhcache.
Regards,
Raju
|
I able to create SelfpopulatinCache within the methodcacheinterceptor using aop.Now How to get SelfPopulatingCache object reference in my spring controller?.Thanks in Advance.
Regards,
Raj
|
Is there any common JSP or page that can provide functionality to see the caches names, their size or contents or provide option to delete elements from cache or remove all ... |
We are using EhCache with JGroups in our webapp for cache replication . But every time I hot deploy the webapp I find that net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator$ReplicationThread continues to run and holds references ... |
HI!
I've searched the internet, and even the ehcache 200+ pages has a word velocity in it on 3 occasions. Well, my plan is to use annotations like @cahcable. As far as ... |
we are using web-ehcache's net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter, that configured by xml, to cache page where is JSON message, but this message can be changed by administrator. How to invalidate cache when administrator changes ... |
I am trying to find an equivalent of MemCache's CASMutator.cas in EhCache. Essentially, I am swapping out EhCache for MemCache and need to implement an interface that calls for setting ... |
I am running an application using ehcache on an arm (arm5, no floating point unit) based machine, tested using both jamvm and openjdk and with a compact flash based rootfs (which ... |
I have a requirement to support refreshing of a cache in a background loader thread. The idea being that, the background loader periodically refreshes cached values without blocking threads wanting to ... |
This must be a very basic:- Just curious, If I don't need distributed, cache-as-sor models, why do we need third party cache libraries (ehcache, memcached) when all you need (for simple ... |
The currently released versions of Ehcache (2.4.1 is the latest) only support settings to control the maximum number of elements in the cache (maxElementsInMemory, and maxElementsOnDisk). How do you determine what ... |
should one use ehcache in favor of varnish? or the other way around? or both?
|
I am using Ehcache in Hibernate. How can i notify the cache that the database is changed. How can i invalidate the data is cached. How can i programatically acheive this?
... |
ehcache is a hugely configurable beast, and the examples are fairly complex, often involving many layers of interfaces.
Has anyone come across the simplest example which just caches something like a single ... |
I am trying to enable replecated ehcache and for some reason it does not seem to be working.
My ehcache.xml -
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
...
|
i am successfully able to cache results for queries that retrieve a single value.
@Cacheable(cacheName = "resourceCache")
public Resource find(int id) throws ResourceNotFoundException{
...
}
But for effiency reasons i need to implemented a method ... |
I use a ehcache that distributes via jgroups. I use UDP multicat for the distribution.
The ehcache lives within a webapp. There are several machines that run that webapp. For some reason ... |
What will happen if there are multiple ehcache.xml files in the classpath? Which one will be picked up?
|
When using ehcache, is there a way to expire cache on certain time of the day?
Thanks,
Lawardy
|
Hello i am trying to setup Ehcache on my local system , There is only java based caching ,i am performing . I got the exception when i just ran the ... |
I am trying to experiment with the overflowToOffHeap and maxMemoryOffHeap tags. I have configured this tag:
<cache name="sample-offheap-cache" maxElementsInMemory="1000" eternal="true" memoryStoreEvictionPolicy="LRU" overflowToOffHeap="true" maxMemoryOffHeap="256M"/>
In my ehcache.xml also have the trial version licence ... |
We're running ehcache 1.5 in a cluster with RMI replication and update servers one by one (think of a load balancer/proxy on top and zero-downtime updates).
We generally don't care about serialVersionUID. ... |
Besides Spring 3.1 and ehcache-spring-annotations, do we have other alternatives that are other than EhCache and Spring?
|
I am trying to do a simple thing like store something in the cache and reterive it next time if it exists. For some reason everything works fine for the first ... |
I am using Ehcache 1.2.3 jar, in my Ehcache.xml i have configured maxElementsInMemory=100000,but the number of elements in memory always goes up till 50500, is there any default size mentioned in ... |
I found a reference to this concept in the EHCache documentation, but I could not find any proper explanation of what it means.
It tried Googling around but to no ... |
Is there a sample Java Config for a standard ehcache XML config file (ehcache.xml) . I am using Spring 3.1.
|
I have SimpleCachingHeadersPageCachingFilter configured in my web.xml and it works fine but how would I go about adding some other stuff to the header like:
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
I went to |
How i can integrate Mybatis with ehcache?
I have defined in my mapper the next:
<cache type="org.mybatis.caches.ehcache.EhcacheCache"/>
I put dependency mybatis-ehcache into pom.xml and i have created my ehcache.xml file
But the console show me ... |
I have a list of 100 items (Strings) that I want to put in ehcache. I will set them to expire after 1 hour. After that I want to read the ... |
I am trying to make my web application faster by using caching of web pages for faster access next time so can anyone provide me guideline how to use Ehcache for ... |
I am working on a projec, the application is in j2ee and I have used ehcache for web page caching but due to the entries of filter it gives me ... |
Using ehCache 2.4.4, I seem to have gotten into a deadlock on the ehCache Segment object. From other logging, I know that the 'waiting thread', 1694 last ran anything 9 ... |
Some days ago I started using ehcache in web app. All was fine, and I do remember that when ehcache was putting something in the cach, or retrieving existing value from ... |
I have a very basic setup: Struts2 web-app, added to it Ehcache-Web and trying to make it work.
Here's my ehcache.xml:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"
...
|
|
Hi, I'm newbie and I have few Q. I'm using Spring 2.5.6 & Ehcache 1.5 [list] How do I enable ehcache logging that prints ehcache DEBUG, INFO, WARN etc stmts Is there any FREE visual tool to monitor cache from Terracotta or others? I set timeToIdleSeconds=10 but after 10 sec I do not see my cache is getting invalidated. After 10 ... |
|
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Unable to load class org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory. Initial cause was org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:91) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:250) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:892) ... 54 more Caused by: net.sf.ehcache.CacheException: Unable to load class org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory. Initial cause was org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:86) at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:67) at net.sf.ehcache.config.ConfigurationHelper.createCachePeerListeners(ConfigurationHelper.java:159) at net.sf.ehcache.CacheManager.configure(CacheManager.java:541) at net.sf.ehcache.CacheManager.init(CacheManager.java:323) at net.sf.ehcache.CacheManager.(CacheManager.java:208) at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:71) ... 58 more Caused by: java.lang.ClassNotFoundException: org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) ... |
Is it possible to use cacheDecoratorFactory with ehcacheServer with REST API. I realized current distribution comes with ehcache-core-2.0.1. This does not let server to accept the configuration ( ehcache.xml) with cacheDecoratorFactory. If we chance it with ehcache-core-2.4.x things start to move. However I could not use the cache as it still gives 404. Any ideas will be highly appreciated. rn |
|
Thanks for your reply. I am not quite sure what you mean when you say "Please use jars of the same version." The maven pom file for hibernate specifies ehcache 1.1, and that is the only version that we have in the project. As an aside, we are successfully using ehcache in the project already to cache domain objects. I am ... |
So what's the best way to get a cache to self-refresh. Essentially, I have a cache of stats information for graphs to display. What I want is for the graphs to always be able to get the data (even if it's stale) but when a request for the cache comes in and gets back stale data, i want to either have ... |
Hi there! I've decided to move from terracotta to plain ehcache for a while, after 2 days of pain trying to get terracotta to work in our environment. Since we do require some monitoring, I'm trying to get the ehcache monitor to work. I've downloaded it and when I run the startup I get some exception on connect timeout. So I'm ... |
Hi, I'm using caches with replication and it works fine so far. But I'm now in the situatuation that more than one application within the same network are using EhCache. As far as I can see it is enough to change the IP address value of multicastGroupAddress to something else for every application. Does the value matter in any way or ... |
Eugene, You know your data the best and you set where it is stored based on your ehcache.xml. To get the details of the information stored in TSA, you _need_ the ehcache.xml of all the clients connecting to the TSA. You need to know the cacheManager and cacheNames and invoke it from a L1 client as "rajoshi" also mentioned. What "rajoshi" ... |
|
Hi, Is there some way to provide a custom implementation for the SizeOf class. Most our objects know their own sizes and it would increase performance a lot to avoid the graph walking. We currently get this message: ObjectGraphWalker.checkMaxDepth():209| The configured limit of 1,000 object references was reached while attempting to calculate the size of the object graph. Severe performance degradation ... |
Hi, after a few days of running our app with Terracotta , the system slowed to a crawl and the client logs showed the following: ********************************************************************** 2011-11-27 20:28:08,101 [TC Memory Monitor] WARN com.tc.runtime.logging.LongGCLogger - Detected long GC>8,000ms. GC count:1. GC Time:9,581ms. Frequent long GC cycles cause severe performance degradation. 2011-11-27 20:28:36,632 [TC Memory Monitor] WARN com.tc.runtime.logging.LongGCLogger - Detected long GC>8,000ms. GC ... |
No worries. Scenario: Doing saturation testing using EhCache 2.6, Terracotta 3.6, bigMemory. Testing what we call "form" objects - these are large object graphs that represent the configuration for html forms. 100kb - 2mb+ each graph. They are expensive to create. This test consists of 2 threads. Throughput of tests is in the order of 50 req/minute during "normal" operation and ... |
Hello All, I am new user of Ehcache . I am trying to use ehcache in my application. I have written CacheManager cacheManager = CacheManager.getInstance(); in init method of my servlet. While loading the servlet I am seeing exception in logs. Its net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory. Initial cause was net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory.(net.sf.ehcache.config.TerracottaClientConfiguration) at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:100) at net.sf.ehcache.terracotta.TerracottaClusteredInstanceHelper.newClusteredInstanceFactory(TerracottaClusteredInstanceHelper.java:178) at net.sf.ehcache.terracotta.TerracottaClient.createNewClusteredInstanceFactory(TerracottaClient.java:199) at net.sf.ehcache.terracotta.TerracottaClient.createClusteredInstanceFactory(TerracottaClient.java:151) at ... |
Hey All, Testing 2.5 with ColdFusion & I believe the sizeOF implementation in EhCache is not correct. If I cache.put() on a single ColdFusion object that contains 1 method and one private property, I get the following warning message: "The configured limit of 1,000 object references was reached while attempting to calculate the size of the object graph" I suspect that ... |
Hi : here are two scenarios Im considering. 1.if the timeout settings betwenn t1 and t2 are high (hours) and t1 does a full garbage connection ( using CMS ) , will the tsa (t2) halt all other t1s that are requesting items from the cache untill the garbage collection has occured. 2. if non-stop caches are used and t1 is ... |
I just upgraded to ehcache 2.5 and now apparently I have to set a maxBytesLocalHeap value on the cache manager. However, I want the value to be the maximum possible one, not set a particular one. we have hundreds of instances that would need reconfiguration otherwise. How can I tell ehcache to just use as much of the heap as it ... |
|
|
|
public class TestEhCache { @Test public void test() { CacheManager mCacheManager = CacheManager.getInstance(); TransactionController mTransactionManager = mCacheManager.getTransactionController(); System.out.println("With all in one transaction ------------"); mTransactionManager.begin(); mCacheManager.addCache("TestCache1"); Ehcache cache1 = mCacheManager.getEhcache("TestCache1"); System.out.println("Before put:"); System.out.println("Keys = " + new ArrayList(cache1.getKeys())); System.out.println("isKeyInCache = " + cache1.isKeyInCache(Long.valueOf(1))); cache1.put(new Element(Long.valueOf(1), Long.valueOf(1))); System.out.println("After put:"); System.out.println("Keys = " + new ArrayList(cache1.getKeys())); System.out.println("isKeyInCache = " + cache1.isKeyInCache(Long.valueOf(1))); cache1.remove(Long.valueOf(1)); System.out.println("After remove:"); ... |
Hi, I'm trying to understand how to implement the SimplePageFragmentCachingFilter. I'm using Spring and Freemarker. As I understand a page fragment filter, you identify fragments of a page you want to cache, specify a key and the page fragment cache stores these elements. When it comes to the SimplePageFragmentCachingFilter: 1. How do you specify a page fragment? 2. Can you manually ... |
What you are looking for is probably a timeout/retry feature for cacheManager which limits the no of times it connects to TSA when its not reachable. While we do not have this feature currently, I think your request is perfectly reasonable. Can you put in a new feature request JIRA in our community forums so that our Eng team can evaluate ... |
We have a classic problem of multiple processes subscribing to same dataset from database. To solve this we are planning to implement a caching mechanism using ehcache. The solution would have a server component that maintains the cache and the client component that uses the cache. Hence it would be quite useful if you have any references to examples on how ... |
Hi we are using ehcache in our project and we have two environments in one server ( developement and QA) the ehcache disk store is set to different values for both environments but when I try to restart the server for QA for example, it doesn't start successfully; throwing an exception like: The Disk store is not active. I think the ... |
|