ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <larry.mead...@gmail.com>
Subject Re: Cache not being flushed
Date Fri, 01 Jul 2005 13:39:05 GMT
Well, if jiggling the handle didn't work, try setting a breakpoint in
the getObject method of the com.ibatis.sqlmap.engine.cache.CacheModel
class.

That is where the handle is connected. ;-)

Larry

PS: You have to forgive Brandon's silliness lately - he just got a new job. :-)


On 7/1/05, Rao, Satish <satish.rao@fmr.com> wrote:
> Any suggestions?
> 
> -----Original Message-----
> From: Brandon Goodin [mailto:brandon.goodin@gmail.com]
> Sent: Thursday, June 30, 2005 3:35 PM
> To: user-java@ibatis.apache.org
> Subject: Re: Cache not being flushed
> 
> 
> Did you try jiggling the handle?
> 
> On 6/30/05, Rao, Satish <satish.rao@fmr.com> wrote:
> >
> > Hello Clinton,
> >
> > I tried debugging the ibatis source code using WSAD. When the server
> starts
> > up, I can see the control go into LRUCacheController and reading each
> of the
> > statements within <flushOnExecute>. I had put breakpoints in flush()
> (within
> > LRUCacheController and CachModel), but that part of the code never
> gets
> > called.
> >
> > I also tried using the <statement> tag instead of <insert> tag as
> follows,
> > and that didn't work either. Also, to keep it simple, I am not using
> any
> > namespaces.
> >
> >
> > <sqlMap>
> >         <cacheModel id ="user-cache" type= "LRU" readOnly="false"
> > serialize="true" >
> >                 <flushInterval hours ="24"/>
> >                 <flushOnExecute statement ="addEmail"/>
> >                 <property name ="cache-size" value= "1000"/>
> >         </cacheModel>
> >         <resultMap id ="list-users-result" class=
> > "com.fmr.gift.strutsplus.domain.User">
> >                 <result property ="id" column= "UID"/>
> >                 <result property ="age" column= "AGE"/>
> >                 <result property ="firstname" column= "FIRSTNAME"/>
> >                 <result property ="lastname" column= "LASTNAME"/>
> >                 <result property ="eventsJoined" column= "UID"
> > select="getEventsJoinedByUserId" />
> >                 <result property ="emails" column= "UID"
> > select="getEmailsbyUserId" />
> >         </resultMap>
> >         <select id ="listUsers" resultMap= "list-users-result"
> > cacheModel="user-cache" >
> >             SELECT
> >                 UID,
> >                 AGE,
> >                 FIRSTNAME,
> >                 LASTNAME
> >             FROM
> >                 USERS
> >         </select>
> >        <statement id="addEmail" parameterClass="java.util.HashMap">
> >             INSERT INTO
> >                 USER_EMAILS (
> >                                     UID,
> >                                     EMAIL )
> >                 VALUES (
> >                         #id#,
> >                         #email# )
> >         </statement>
> > </sqlMap>
> >
> >
> > -----Original Message-----
> > From: Clinton Begin [mailto:clinton.begin@gmail.com]
> > Sent: Thursday, June 30, 2005 12:01 AM
> > To: user-java@ibatis.apache.org
> > Subject: Re: Cache not being flushed
> >
> >
> >
> > It looks right....but this is the second time this has been reported
> in
> > recent months.  We have about 6 unit tests just to verify cache
> flushing on
> > execution, so I'm not sure what it could be.  Any chance you could
> debug
> > using the ibatis source code, so you could step through the cache
> model?
> > (put a breakpoint in CacheModel or in LRUCacheController...probably
> the
> > flush method of either...)
> >
> > Cheers,
> > Clinton
> >
> >
> >
> >
> > On 6/28/05, Rao, Satish <satish.rao@fmr.com> wrote:
> > >
> > >
> > > I have the following xml
> > >
> > > <sqlMap namespace ="User">
> > >         <cacheModel id ="user-cache" type= "LRU" readOnly="false"
> > serialize="true" >
> > >                 <flushInterval hours ="24"/>
> > >                 <flushOnExecute statement ="addUser"/>
> > >                 <flushOnExecute statement ="removeUser"/>
> > >                 <flushOnExecute statement ="addEmail"/>
> > >                 <flushOnExecute statement ="removeUserEmails"/>
> > >                 <property name ="cache-size" value= "1000"/>
> > >         </cacheModel>
> > >         <resultMap id ="list-users-result" class=
> > "com.fmr.gift.strutsplus.domain.User">
> > >                 <result property ="id" column= "UID"/>
> > >                 <result property ="age" column= "AGE"/>
> > >                 <result property ="firstname" column= "FIRSTNAME"/>
> > >                 <result property ="lastname" column= "LASTNAME"/>
> > >                 <result property ="eventsJoined" column= "UID"
> > select="getEventsJoinedByUserId" />
> > >                 <result property ="emails" column= "UID"
> > select="getEmailsbyUserId" />
> > >         </resultMap>
> > >         <select id ="listUsers" resultMap= "list-users-result"
> > cacheModel="user-cache" >
> > >             SELECT
> > >                 UID,
> > >                 AGE,
> > >                 FIRSTNAME,
> > >                 LASTNAME
> > >             FROM
> > >                 USERS
> > >         </select>
> > >         <delete id ="removeUser" parameterClass= "java.lang.Long">
> > >             DELETE FROM
> > >                 USERS
> > >             WHERE
> > >                 UID = #value#
> > >         </delete>
> > > </sqlMap>
> > >
> > > The caching works fine for select. But when I delete a user, I
> expected
> > the cache to be be flushed because of the following entry in cache
> model -
> > <flushOnExecute statement="removeUser"/> . This does not happen. When
> I
> > perform removeUser operation, the user list is displayed again and
> shows the
> > user id that was deleted.
> > >
> > > Am I doing anything wrong here?
> > >
> > >
> >
> >
>

Mime
View raw message