RE: caching of query results

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Fri Jan 28 2005 - 12:43:40 EST

  • Next message: Bryan Lewis: "Re: caching of query results"

    Hey Bryan (and others), one thing that "bit" me about the caching is
    that it is too damned good! Be aware that things will live in your
    cache for potentially long periods of time. I was doing caching in a
    utility app and went home over the weekend. Came back, accessed it
    again, and was getting data from the previous week, even though things
    had changed over the weekend as our jobs were running. I guess I was
    expecting them to timeout or something, but as long as they don't get
    pushed out of the cache, they stay alive.
     
    Just keep that in mind.
     
    /dev/mrg
     

            -----Original Message-----
            From: Bryan Lewis [mailto:brya..aine.rr.com]
            Sent: Friday, January 28, 2005 11:42 AM
            To: cayenne-use..bjectstyle.org
            Subject: Re: caching of query results
            
            
            Okay, it's working now. This way works (as in the user's
    guide):
             
                // Starting with a named query...
                query.setRefreshingObjects(boolean refresh);
                headlines = dc.performQuery(query);
            
            What I was doing the first time didn't work:
             
                DataMap theMap = (DataMap)
    dc.getDataMaps().iterator().next();
                theMap.addQuery(query);
                headlines = dc.performQuery(queryName, refresh);
            
            Somewhere I got the idea I was supposed to be using the second
    version of performQuery(), which wants the query to be stored in the
    DataMap. I guess one shouldn't try to use that except with queries that
    were created in the modeler GUI.
             
            Thanks! This feature is going to be very useful.
             
             
             



    This archive was generated by hypermail 2.0.0 : Fri Jan 28 2005 - 12:43:51 EST