cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Lewis <br...@maine.rr.com>
Subject caching query behavior changed?
Date Tue, 01 Aug 2006 18:52:13 GMT
I have some old code that I've been running for a long time.  It creates
a caching SelectQuery like this:

    SelectQuery query = new SelectQuery("MyEntityName");
    query.setCachePolicy(QueryMetadata.SHARED_CACHE);
    query.setName("MyQueryName");
    if (refreshing) {
        query.setRefreshingObjects(true);
    }
    else {
        query.setRefreshingObjects(false);
    }
    List objects = dataContext.performQuery(query);

Today someone pointed out to me that the refresh is never happening. 
Indeed, if I call this code with refreshing = true, the log doesn't show
any SQL generated.  (It does emit SQL the first time, of course.)  I
tried various permutations of my code -- with or without ordering and
prefetching, with local or shared cache.  No refreshes.  I
double-checked that isRefreshingObjects() returns true.

I noticed that the on-line User Guide now recommends specifying such
queries in the modeler.  When I do that, the query works as expected. 
The code boils down to:

    List objects = dc.performQuery("MyQueryName", refreshing);

I'm wondering whether this was a change in a recent version that I
missed.  Must caching queries be specified only in the modeler now?  Or
is this unexpected and I should try to distill a test case?



Mime
View raw message