ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eva Kwan <Eva.K...@huskyenergy.com>
Subject RE: iBATIS read/write non-serialize cache
Date Tue, 13 May 2008 17:26:53 GMT
Adding a parameter didn't seem to help.

I'm using version 1.6.1.  When I trace through the iBATIS source, CachingStatement seems to
be using the RequestScope as a part of the key for my configuration, and the hashcode for
request is different for each of my select calls.

                private CacheKey GetCacheKey(RequestScope request)
                {
                        ...

                        if (!cacheModel.IsReadOnly && !cacheModel.IsSerializable)
                        {
                                cacheKey.Update(request);
                        }
                        return cacheKey;
                }

Thanks,
Eva


-----Original Message-----
From: Clinton Begin [mailto:clinton.begin@gmail.com]
Sent: Tuesday, May 13, 2008 11:14 AM
To: user-cs@ibatis.apache.org
Subject: Re: iBATIS read/write non-serialize cache

I think it might be the case of "no parameters"...   for kicks, add a
parameter to the query to see if that helps.  a simple
parameterClass="int" should works.

Also, which version are you using?  I thought this was fixed...

Clinton

On Tue, May 13, 2008 at 11:02 AM, Eva Kwan <Eva.Kwan@huskyenergy.com> wrote:
>
>
>
>
> I have a cache model set up like this:
>
>
>
>     <cacheModel id="FindAllCache" implementation="LRU" readOnly="false">
>
>       <flushInterval minutes="5"/>
>
>       <property name="CacheSize" value="2"/>
>
>     </cacheModel>
>
>
>
>     <select id="FindAll" extends="Base" resultMap="Result"
> cacheModel="FindAllCache">
>
>     </select>
>
>
>
> I have turned on iBATIS logging.  When I execute the select statement more
> than once within one session, the logs say that there is a cache miss each
> time.
>
>
>
> How do I get a read/write (per session) cache to work?

Mime
View raw message