I am trying to use the JDBC Cache Loader to persist TreeCache to DB, Here is
how i do it....
public void configureCache(){
try {
System.out.println("Inside configureCache");
Properties properties = new Properties();
try {
properties.load(new
FileInputStream("jdbc-cache.properties"));
} catch (IOException e) {
e.printStackTrace();
}
PropertyConfigurator config = new PropertyConfigurator();
config.configure(cache,getConfigFile());
JDBCCacheLoader jdbcCacheLoader=new JDBCCacheLoader();
jdbcCacheLoader.setConfig(properties);
jdbcCacheLoader.setCache(cache);
jdbcCacheLoader.create();
jdbcCacheLoader.start();
Fqn fqn=new Fqn("PaymentCache");
System.out.println(cache.get(fqn));//I get NULL HERE
} catch(Exception e) {
e.printStackTrace();
}
I am following the life cycle of Loader as described in API fo CacheLoader
interface. But i do a get on TreeCache cache i get a null pointer, looks like
the cache is not getting any thing from loader the data is avaliable on the DB
i can directly do a get on jdbccacheloader and get the info.
Where am i going wrong is this the right way to attach a loader to TreeCache....
Thanks in advance
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959717#3959717
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959717
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user