Re: SQL CallableStatement execute and close

From: Charles Fineman (cfineman-no&spam_at_yahoo.com)
Date: 03/17/04

  • Next message: Anton Nemychenkov: "Re: Oracle JDBC driver exception "Stream has already been closed""
    Date: Wed, 17 Mar 2004 14:12:45 -0500
    
    

    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: Anton Nemychenkov: "Re: Oracle JDBC driver exception "Stream has already been closed""

    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)
    • Re: Disable write caching?
      ... How do you disable write caching if the option is grayed ... >Curiosity, why turn it off? ... All the computers that I have access to, ... it's an option thru the driver. ...
      (microsoft.public.windowsxp.general)
    • 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)