• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

Requests not selecting Entity from the eHcache hitting the DB instead

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27281
193
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I believe this is your answer. You need to configure your defaultCache.
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic