cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gentry, Michael \(Contractor\)" <>
Subject RE: caching query behavior changed?
Date Tue, 01 Aug 2006 19:03:52 GMT
I know there were some changes in this area with 1.2, but don't recall
all the details.  In fact, I believe I fixed a bug in regards to this
(I'll have to find the ticket).  My gut feeling is this is unintended


-----Original Message-----
From: Bryan Lewis [] 
Sent: Tuesday, August 01, 2006 2:52 PM
Subject: caching query behavior changed?

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");
    if (refreshing) {
    else {
    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?

View raw message