Re: SQL CallableStatement execute and close
From: guy (guymeital2_at_walla.co.il)
Date: 03/18/04
- Previous message: Robert: "Re: Recomendations for a low priced jdbcOdbc bridge for talking to Access"
- In reply to: Charles Fineman: "Re: SQL CallableStatement execute and close"
- Next in thread: Charles Fineman: "Re: SQL CallableStatement execute and close"
- Reply: Charles Fineman: "Re: SQL CallableStatement execute and close"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Mar 2004 01:11:31 -0800
So what is better to keep the statement open or to build it all over again.
I need to call it once in a minute so it is just a matter of resources.
Charles Fineman <cfineman-no&spam@yahoo.com> wrote in message news:<ca395$4058a2b2$d89e2d9a$9271@dcanet.allthenewsgroups.com>...
> No. Once you've closed it, the driver will release the resources
> associated with the statement (this is putting aside the caching
> that many of the JDBC drivers are using these days).
>
> As far as performance goes, yes it will almost certainly effect
> your performance (again ignoring caching). As far as Oracle goes,
> I seem to recall that they keep around compiled code in the SGA
> unless it gets bumped out so you might not have to pay the
> compilation costs again.
>
> If you decide you want to use statement caching then you should keep
> two things in mind:
>
> 1) The "out of the box" caching that the drivers tend to implement is
> LRU. If you have a relatively expensive (to compile) prepared statement
> it might get bumped out by smaller ones.
>
> 2) If you decide to do your own caching (we did this to implement a
> use-count based caching policy) you need to keep in mind that you can
> only use a prepared statement with the connection it was originally
> created on (at least that was true for Oracle). This means you need to
> have a cache for each connection. I wrote a Driver and Connection
> "decorator" class to do this.
>
> guy wrote:
> > If I'm using the close() method after executing a callableStatement.
> > I need to activate the procedure in a predefined interval.
> > two questions:
> > 1. can I execute the statement again without building it all over again?
> > 2. Does it make any difference (performance wise)?
- Previous message: Robert: "Re: Recomendations for a low priced jdbcOdbc bridge for talking to Access"
- In reply to: Charles Fineman: "Re: SQL CallableStatement execute and close"
- Next in thread: Charles Fineman: "Re: SQL CallableStatement execute and close"
- Reply: Charles Fineman: "Re: SQL CallableStatement execute and close"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|