Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Gemfire and the fly likes Calling cache loader for Spring Gemfire SQL query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Caching » Gemfire
Bookmark "Calling cache loader for Spring Gemfire SQL query" Watch "Calling cache loader for Spring Gemfire SQL query" New topic
Author

Calling cache loader for Spring Gemfire SQL query

Roshni Chandrashekar
Greenhorn

Joined: Jan 14, 2012
Posts: 5
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

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Calling cache loader for Spring Gemfire SQL query
 
Similar Threads
Spring MVC JDBC
"Casting" from a Superclass to a subclass
Abstract classes vs. interfaces
Coupling!!
How to start a daemon thread at application startup in a Spring application