Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Requests not selecting Entity from the eHcache hitting the DB instead

 
Ranch Hand
Posts: 652
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: 652
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: 652
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: 23514
161
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: 652
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,
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic