Two things.

First,

Ensure that your global cache setting is enabled in your config class.

Second,

Modifying the database behind the scene will not produce good results.  The
cache in your JVM will have no clue that the data was changed and you will
always get the cached results.

Nathan


On Nov 1, 2007 6:33 PM, Odelya Glick <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I am trying to implement cache in IBATIS.
>
> I declared the following statement:
>
> <select id="getObituaryById" resultClass="obituary"
>                parameterClass="string" cacheModel="obituaryCache">
>                select ID as id,
>                FIRST_NAME as firstName, MID_NAME as midName, SUR_NAME as
>                surName, BIRTH_DATE as birthDate, PASS_DATE as passDate,
> BODY as
>                body, PHOTO_LINK as photoLink, THUMB_PHOTO_LINK as
>                thumbPhotoLink FROM OBITUARY where ID =
>                #value#
>        </select>
>
> And the cacheModel:
> <cacheModel id="obituaryCache" type="LRU">
>                <flushInterval hours="24" />
>                <property name="cache-size" value="1000" />
>                <flushOnExecute statement="insertObituary" />
>        </cacheModel>
>
> But it doesn't seem to be that the obituary object is being cached!
> When I change a value in Oracle 9i, and do refresh to the page, I get the
> newly updated information!
>
> The code to get the information is:
>
> public ObituaryData getObituaryById(String obitId) {
>                  return  (ObituaryData) queryForObject("getObituaryById",
> obitId);
>        }
>
>
> Thanks
>
> Odelya
> web-programmer
>
>
>

Reply via email to