[jboss-user] [JBossCache] - JDBCCacheLoader Problems

chicago_pool_dude do-not-reply at jboss.com
Thu Jul 20 18:08:43 EDT 2006


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



More information about the jboss-user mailing list