Question about Caching.

From: Nikos Paraschou (niparas..mail.com)
Date: Tue Apr 21 2009 - 05:28:56 EDT

  • Next message: Andrus Adamchik: "Re: Question about Caching."

    Hello,

    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
    Results.

    I wrote the following code:

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

            List allVehicles = context.performQuery("selectVehicles",
    false);
            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



    This archive was generated by hypermail 2.0.0 : Tue Apr 21 2009 - 05:28:33 EDT