Στις 21-04-2009, ημέρα Τρι, και ώρα 13:21 +0300, ο/η Andrus Adamchik
Shouldn't it first look in cache?
Yes it should. Are you using the same set of parameters in both cases?
In the first case I am just calling the query "selectVehicles" which is
stored in DataMap without defining any parameters. All vehicles are
In the second case I want to retrieve a specific vehicle so I define the
params.put("plate", "koz-6657") and call
performQuery("selectVehicles", params, false);
The second call doesn't retrieve the requested vehicle from the cache
but instead, it sends a query to the DB.
Why is this happening? Is it normal?
And also which version of Cayenne is this?
I am using Cayenne 2.0.4.
On Apr 21, 2009, at 12:28 PM, Nikos Paraschou wrote:
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();
List allVehicles = context.performQuery("selectVehicles",
List specificVehicle = context.performQuery("selectVehicles",
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
it sends a query to the database.
Why is this happening? Shouldn't it first look in cache?