Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: statement caching in oracle

Re: statement caching in oracle

From: Frank Gerlach <Frank.Gerlach_at_brokat.de>
Date: Tue, 16 Jan 2001 16:39:05 +0100
Message-ID: <3A646B19.66A861F8@brokat.de>

I suggest to use PreparedStatement only, which will allow Oracle to reuse already parsed and optimized statements. Oracle does this by creating a hash over the statement text (the "SELECT.."), which means it will not work without a PreparedStatement. I do not think it is a good idea to call internal methods of the Oracle jdbc implementation. Use the Oracle Server admin tools to change the statement cache size, as the statement cache is a server-side entity !

miso_pach_at_my-deja.com wrote:

> Hi
>
> In my java program i repetedly call certain queries. I would like to
> take advantage of a statement cache, so that these queries would not
> have to be parsed by the database every time and thus improve the
> performance.
>
> I am using the latest JDBC thin driver (8.1.7), which provides
> API for setting the size of the clients statemet cache. This works fine
> with a physical instance of a PooledConnection. However if am trying
> to use it in combination with OracleConnectionCacheImpl class I will
> only get access to logical connections which don't let you set
> their statement cache. I tried calling
> setStmtCacheSize()
> on the OracleConnectionCacheImpl which didn't work. The prepare
> statement on the 2nd connection just hanged. The first connection was
> bizzarly fine..
>
> How can I set the statement cache for all connection created by the
> OracleConnectionCacheImpl class?
>
> Insted of setting this from the java program I could surly set the
> connection cache somehow for the whole database. How do I do that?
> This could be a workaround if the oracle's java API doesn't let me do
> it.
>
> any responses would be appreciated.
>
> thanks,
>
> Miso
>
> Sent via Deja.com
> http://www.deja.com/
Received on Tue Jan 16 2001 - 09:39:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US