Re: SQL CallableStatement execute and close

From: guy (guymeital2_at_walla.co.il)
Date: 03/18/04

  • Next message: gbalzola: "Question about OJB"
    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)?


  • Next message: gbalzola: "Question about OJB"

    Relevant Pages

    • Re: SQL CallableStatement execute and close
      ... your performance (again ignoring caching). ... compilation costs again. ... have a cache for each connection. ... I wrote a Driver and Connection ...
      (comp.lang.java.databases)
    • Re: Long running open connections badly leak memory
      ... > I wrote a batch import process that uses connection pooling, ... and I tracked it down to the Microsoft JDBC driver ... > If the driver is doing any caching on purpose, ... The MS driver does indeed do a lot of unnecessary caching (such as ...
      (microsoft.public.sqlserver.jdbcdriver)
    • Re: 300GB drive NTFS cluster size?
      ... Make sure that you are using the driver provided by the manufacturer ... You may also want to disable write caching for ... Disk management ...
      (microsoft.public.win2000.file_system)
    • Help, install ISA and loose internet and exchange pop3 download
      ... If you're installed in caching only mode, ISA cannot block ... you're not really in caching only mode. ... >come through my pop3 connection, ... >did the firewall and email settings etc after I told it I ...
      (microsoft.public.windows.server.sbs)
    • Re: [9fans] killing processes
      ... for any other general access caching really helps. ... not all news are bad though -- one can boot from a remote file server ... benefits of a very small response time) and cpu to a remote cpu server ... just for the compilation. ...
      (comp.os.plan9)