ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James, Steven" <Steven.Ja...@logicacmg.com>
Subject RE: cacheModel still hitting database
Date Tue, 22 Feb 2005 09:24:38 GMT
I have to agree with mark. I have been unable as yet to get this to 
work. I have tried using a select and statement. In both refering to 
the cacheModel, but if i change the underlying database vi client then 
the change is reflected in next select in the program. my DAO is persisting 
so in theroy this should work. I have to admit i am new to ibatis so i could 
be making a simple oversight but using the jpetstore code, Wherever a cachemodel
is defined it is not reffered to by any select or statement block? And the ibatis
documentation shows that you do define the cachemodel. Therfore does the jpetstore example
really use caching.

Whilst this is not a big problem in my project it would be nice to know how this works. 

Any help or pinters to tutorials, documentation or code would be appriciated.

Thanks to all the ibatis team this is a usefull and intuative product.


-----Original Message-----
From: Mark Bennett [mailto:mark.bennett@ncmail.net]
Sent: Mon 2/21/2005 10:08 PM
To: ibatis-user-java
Subject: cacheModel still hitting database
I'm trying to get the cacheModel working, but it keeps hitting the database.
This is just an example so please ignore the context.

I'm using iBatis-2 and this setup returns the data properly.  I get no
errors.  This is run through a web container and not a unit test so the
cache should persist.  The query object is an Integer so it should hash the
same each time.  However, whenever I cange the data in the databse, the
change shows up on the page.  Any advice?  Thanks.


  <cacheModel id="drugScreenCache" type="LRU" readOnly="true"
    <flushInterval hours="12"/>
    <property name="cache-size" value="500"/>

  <resultMap id="drugScreenListResult" class="drugScreen">
    <result property="id" column="ACTID"/>
    <result property="testDate" column="TESTDATE"/>

  <select id="getDrugScreenListByJuvenile"
    SELECT *
    FROM drugscreen
    WHERE rsrcid = #value#

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.
View raw message