• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Requests not selecting Entity from the eHcache hitting the DB instead

 
Ranch Hand
Posts: 634
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to EhCache, so not to sure what the problem is, but I have set up log for debug and stats on both eHcache and Hibernate. Sorry if there is to much logs I have broken it down.

What I did was a select on a Bank Entity that brought back a collection of Accounts, which brought back a collection of funds. This is the logging for the initial request



 
Tony Evans
Ranch Hand
Posts: 634
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the same request again for the same bank object, from reading the logs it doesnt look to me that its calling into eHcache, that its just running a staticSQL into the DB
 
Tony Evans
Ranch Hand
Posts: 634
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have set the ehcache.xml and it is being loaded. I just used a default one






I am not going to go through every Entity as it will overload the logging, but its the same for each one, so taking Bank


logging for setting it up in ehCache
 
Saloon Keeper
Posts: 21941
149
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I believe this is your answer. You need to configure your defaultCache.
 
Tony Evans
Ranch Hand
Posts: 634
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that might be the problem. Its funny none of the examples use CacheDecoratorFactory, as I understand it you set the Enity as a Cache, and its just supposed to create that in the cache, well thats the easy bit. There are also plenty of examples of using defaultcache, aagin none with a CacheDecoratorFactory set up. I will read up and see why I need to create a concrete object that extends CacheDecoratorFactory, and what its supposed to do. But this might be a red herring. But will close down each route,
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic