• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

Calling cache loader for Spring Gemfire SQL query  RSS feed

Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using Gemfire cache to store application data and if the data is not found in the cache, we try to get it from the MySQL database using hibernate.

The database call (When the cache does not have the data) is made from the class implementing CacheLoader interface's load method. The method seems to get called if we search the cache using an id. But how do we make sure the method gets called when we run a sql query against the cache? Or can we write an overloaded method or use a different interface maybe?

For example, this works fine:

But what do we do if its an sql query like:

Below is the class implementing the CacheLoader interface

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!