cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikos Paraschou <>
Subject Question about Caching.
Date Tue, 21 Apr 2009 09:28:56 GMT

I created an Object Select Query in the Modeller which selects * from
table Vehicles. The query has a qualifier (plate = $plate). In Result
Caching I selected Shared Cache and unchecked the checkbox Refresh

I wrote the following code:

        Map params = new HashMap();
        params.put("plate", "koz-6657");

        List allVehicles = context.performQuery("selectVehicles",
        List specificVehicle = context.performQuery("selectVehicles",
params, false);

I noticed that the first call of performQuery stores the retrieved
Vehicle Objects in cache.
But the second call, instead of getting the specific vehicle from cache
it sends a query to the database.

Why is this happening? Shouldn't it first look in cache?

Thank you,
Nikos Paraschou

View raw message