[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: ani_1234  XML
Profile for ani_1234 -> Messages posted by ani_1234 [11]
Author Message
Hello
I am using cacheable in my code . I am experiencing a issue while using it .
I have a method in ONE class which is cacheable , its working. After this class second gets the call , in which I have another method which is also cacheable, this method in the second class isnt working . I mean even though the @cacheable is there , the method code executes every time rather than picking from cache.
Does any body have experienced this kind of issue , please post.
Rest all , if you would put your thoughts , will be helpful.
"cacheName is not resolvable " . The cachable class contains key,value and condition only no variable like cacheName.
/////////////////
<?xml version="1.0" encoding="UTF-8"?>

<ehcache name="ATCatrche" updateCheck="false">
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"/>
<cache name="attributes"
maxElementsInMemory="10000"
maxElementsOnDisk="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
memoryStoreEvictionPolicy="LFU">
</cache>
<cache name="multiSelectOptions"
maxElementsInMemory="10000"
maxElementsOnDisk="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
memoryStoreEvictionPolicy="LFU">
</cache>
<cache name="othercacheandson"
maxElementsInMemory="100"
maxElementsOnDisk="0"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="0"
memoryStoreEvictionPolicy="LFU">
</cache>
</ehcache>
/////////////////
Currently I am using standalone ehcache i.e. with out TC but in future I will be using TC opensource.
@Cacheable(value = "attributes", key = "#p0")
public CacheableBean<Attribute> getCachedAttributes(String cacheKey, Connection connection) {

}

I am caching a POJO bean with above method.
Hello there,
I have used @ cacheable on a method which I have not kept synchronized , because on google code site http://code.google.com/p/ehcache-spring-annotations/wiki/UsingCacheable' target='_new' rel="nofollow"> http://code.google.com/p/ehcache-spring-annotations/wiki/UsingCacheable
of ehcache , in @cachable setting sections , its clearly written that its synchronized but actually its not. I have tested with two threads simultaneously accessing the @cachable method . Both threads enter the method instantly with out waiting.
Is there any setting to enable synchronization on @cachable annotation?
Sorry I coudnt get you Sir, I have tried the urls to search the answer , but dint get what I was looking for i.e. starting/stopping terracotta server programitically most probably thru java code.
.Currently I am starting/stopping the terracotta server using start-tc-server.bat script file only. But now I have a need where I haveto start the terracotta server on my webserver e.g. jboss/tomcat startup.
thanks for reply .currently I am starting/stopping the terracotta server using start-tc-server.bat script file only. But now I have a need where I haveto start the terracotta server on my webserver e.g. jboss/tomcat startup most prob ably through java code.
Hello there,
I am using terracotta-ehcache spring version in my app . Currently I have to start terracotta server using the batch file start-tc-server.bat and it works as expected.
Now I have a need to start the terracotta server through java code rather than a batch file . I am using jboss as app server and I need to start/stop the terra cotta server when jboss starts/stops. Is there any way to achieve this using spring or through java code?
Please post your inputs/experiences related to the same.
thanks in advance
Aniruddha
Hello there,
I am using terracotta-ehcache in my app . Currently I have to start terracotta server using the batch file start-tc-server.bat and it works as expected.
Now I have a need to start the terracotta server through java code rather than a batch file . I am using jboss as app server and I need to start/stop the terra cotta server when jboss starts/stops. Is there any way to achieve this?
Please post your inputs/experiences related to the same.
thanks in advance
Aniruddha
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.<init>(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 net.sf.ehcache.CacheManager.init(CacheManager.java:344)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:299)
at net.sf.ehcache.CacheManager.create(CacheManager.java:697)
at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:717)
at com.accept.servlets.ComnStartupServlet.init(ComnStartupServlet.java:117)
at com.accept.servlets.ComnStartupServlet.init(ComnStartupServlet.java:52)
at com.accept.servlets.PlannerStartupServlet.init(PlannerStartupServlet.java:49)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NoSuchMethodException: net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory.<init>(net.sf.ehcache.config.TerracottaClientConfiguration)
at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getConstructor(Class.java:1657)
at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:91)
... 28 more

However instead of servlet if I put the same statement in my JSP which gets called on user click , there is no exception and it works fine.
But I need to use the cache manager at start of my web app only i.e. in servlet.
If any one can put their valueable comments/experiences about the same , will be very helpful.
thanks

 
Profile for ani_1234 -> Messages posted by ani_1234 [11]
Go to:   
Powered by JForum 2.1.7 © JForum Team