Apparently, I put break points in the get and put methods of the
org.hibernate.cache.EhCache and I see that the put method is being called by
the NonstrictReadWriteCache.put method but the NonstrictReadWriteCache.get
and EhCache.get methods are never getting called at all?
My controller is querying personManager.getAll(). Does someone see a problem
with this?

On Mon, Jan 12, 2009 at 10:18 AM, Kannan Ekanath
<[email protected]>wrote:

> Hi Guys,Appfuse version 2.x
>
> Before I start my first question, thanks for building such a nice
> framework. Before Appfuse, one had to assemble security, persistence, mvc,
> cache etc brick by brick and frameworks like these are going to make J2EE
> compete with Rails :) (that boasts of letting user create CRUD apps in 10
> minutes). I built a couple of model objects and did the UI for them. Now I
> am trying to do the caching with Ehcache.
>
> I added the lines to hibernate.cfg.xml
>
> <property
> name="hibernate.cache.provider_class">org.hibernate.cache.EHCacheProvider</property>
> <property name="hibernate.cache.use_second_level_cache">true</property>
>
> and added a cache name to my ehcache.xml
> <cache name="mycache"
>      maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="300"
>      timeToLiveSeconds="600" overflowToDisk="true" />
>
> and annotated the entities with @Cache(region="mycache", usage =
> CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
>
> Now I would expect Ehcache to cache all my entities that are marked above.
> I put a break point in personManager.getAll() and it seems everytime I
> refresh the page this method gets called. I change the value in database and
> I get it reflected in the console. I enabled hibernate show sql and I can
> see queries getting fired. So apparently the cache is not being used. There
> are no errors what so ever in console or logs. Can someone tell me what is
> going wrong in this case?
> --
> Regards,
> Kannan Ekanath
>



-- 
Regards,
Kannan Ekanath

Reply via email to