This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Requests not selecting Entity from the eHcache hitting the DB instead  RSS feed

 
Ranch Hand
Posts: 632
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: 632
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: 632
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
 
Bartender
Posts: 20770
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • 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: 632
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,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!