ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Dynamic Query and Prepared Statement Caching
Date Mon, 05 Jan 2009 15:46:22 GMT
iBATIS does cache prepared statements.  The cache is based on the SQL
string that is created after the dynamic query is resolved.  So if you
have 300 different combinations of criteria, then you will have 300
cached prepared statements.

Jeff Butler


On Sun, Jan 4, 2009 at 9:01 PM, Anurag Sethi <asethi_im@yahoo.com> wrote:
> Hi,
> I am using the Abator generated queryByExample sql/DAO classes. I am specifically using
the Criteria class in there and have a bunch of criteria ored in the example that I send as
the parameter.
>
> So in general, I have the actual query with different number of criteria ored.
>
> Does Ibatis cache the resulting Prepared statements too? If not, what is the best way
to make sure that the statements are not prepared every time the queryByExample interface
is called. Its a big performance hit.
>
> I have also tried generating an sql map programatically as part of the bootstrap sequence
and actually put in around 300 different static queries in there and call the one based on
the number of criteria I would have had to or using the queryByExample dynamic query. This
should at-least lead to caching of the prepared statements. Please correct me if I am wrong.
>
> Thanks,
> Anurag
>
>
>
>
>

Mime
View raw message