Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSource Client-Side Caching - Please Help

    Hello:

    Maybe I'm not reading the docs correctly or something but I'm trying to get my DataSource to do the following:

    1) Read all of its data from the server
    2) Cache the results so that any subsequent requests are read from the cache

    Sounds simple enough but everything I've tried is failing. Here's an example:

    Code:
    public class ListSource extends RestDataSource {
    
    	private static ListSource instance = null;
    	
    	public static ListSource getInstance(){
    
    
    
    		if(instance == null){
    		        //Set up my criteria for the server-side read
    			Criteria cs = new Criteria();
    			cs.addCriteria("app","lists");
    								
    			instance = new ListSource("DBList_DS");
                            //Tell the data source to cache its data
    			instance.setCacheAllData(true);
                            //Do my fetch
    			instance.fetchData(cs);		
    			
    		}
    		
    		return instance;
    	}
    The problem is that the DS will make a client-side call which of course won't work because the data resides on the server. So is there a way to pull the data from the server and THEN tell the DS to cache the response while still allowing the normal add/update/remove calls to work against the server?

    Thanks for your help...

    Chris

    #2
    Anyone?....

    Thanks

    Comment

    Working...
    X