You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Roberto Dorich <RD...@intralinks.com> on 2005/01/11 16:59:24 UTC

Are IBatis dynamic queries cached on the server side?

I assume you use Preparedstatments querying the DB.  As I understand from 
my DBA, it is important to cache these prepared statments to make Oracle 
faster.  Could you let me know if IBatis caches these?
        1.  static (i.e. simple SQL queries)
        2.  dynamic (i.e. queries that get modified with isEqual, etc

If so, where is it documented?

Thank you,

- Roberto

Re: Are IBatis dynamic queries cached on the server side?

Posted by Clinton Begin <cl...@gmail.com>.
Couple of things:

1) You can't cache any statement that changes.  So if you're talking
about dynamic statements, they cannot be cached, because most likely
they change on nearly every request.

2) It is not entirely true that caching ALL prepared statements will
make your system faster.  In fact, keeping such resources reserved
unecessarily would be a drain on system resoures.

3) This is a driver responsibility.  I've implemented prepared
statement caching in the past.  It's hard, problematic and best left
to the vendors, as different databases will react differently to a
given cache strategy (think timeouts or open cursor limits in Oracle).

If it is as important as you'd expect, Oracle will have implemented it
in their driver.

Cheers,
Clinton


On Tue, 11 Jan 2005 10:59:24 -0500, Roberto Dorich
<RD...@intralinks.com> wrote:
>  
> I assume you use Preparedstatments querying the DB.  As I understand from my
> DBA, it is important to cache these prepared statments to make Oracle
> faster.  Could you let me know if IBatis caches these? 
>         1.  static (i.e. simple SQL queries) 
>         2.  dynamic (i.e. queries that get modified with isEqual, etc 
>  
> If so, where is it documented? 
>  
> Thank you, 
>  
> - Roberto 
>