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: caching... per "select"?
Date Mon, 26 Sep 2005 03:45:44 GMT
Caching in iBATIS is based on the statement and the parameters passed to it.

So, if you execute "select * from Account where id = ?" three times,
with 3 different id parameters, you'll get 3 cache entries. If you
execute "select * from Account where name = ?" with the name of one of
those three, you will get a 4th cache entry, even if the row returned
is the same as one of the other, earlier select statements.

In iBATIS, there is currently no concept of "object identity", so if
you request account #5 three different ways, you'll get 3 different


On 9/25/05, Michael Campbell <michael.campbell@gmail.com> wrote:
> Setting up caching in iBATIS seems frighteningly easy, so I'm anxious
> to try it.  Can anyone give me any idea of what GETS cached; it seems
> to be per statement/select.  Can I assume that when some class is
> listed in the parameterClass, that's part of the key? Is it the entire
> thing, or just the attributes of the parameter that get used?
> Lastly, how smart is this?  If I have a "getById" and
> "getByDescription" and they both return the same object, that's an
> object in each cache, since they're different selects/statements,
> right?
> Thanks!
> --
> I tend to view "truly flexible" by another term: "Make everything
> equally hard". -- DHH

View raw message