Thanks Perrin, for your valuable inputs.

I tried it from the command-line. The disconnect was
almost instantaneous. The TCP connection to the Oracle
server moved from 'ESTABLISHED' to 'TIME_WAIT' state as
soon as $dbh->disconnect was called.

So am facing this problem after mod_perl integration with
my snip below. <this same snip works well on command-line>.
I think mod_perl is not letting the database connection to
be torn down!! I am not using Apache DBI though, so
persistent connection concept can be ruled out.

Any more clues that I may want to take a look at?

Here's my Perl snip for reference:

use DBI; my $dbh = 0; sub connect_db { if (defined $dbh) { eval { $dbh->ping; }; if (!$@) { #success return preserver database handle return $dbh; } } #ok, create a new database handle my $retry_count = 5; while ((!$dbh) && ($retry_count > 0)) { $dbh = DBI->connect('dbi:Oracle:linuxdb3','scott', 'ti +ger'); $retry_count -= 1; sleep(1); } if (!$dbh) { # Database connection failed return 0; } # Database connection OK return $dbh; } sub disconnect_db { if (defined $dbh) { eval { $dbh->ping; }; if ($@) { # Database handle invalid as ping failed return 0; } } # Disconnect Database connection $dbh->disconnect; return 1; }

--
Thanks,

Vivek AN

In reply to Re^2: Perl Oracle Database Connections remain ESTABLISHED!! by vivek_an
in thread Perl Oracle Database Connections remain ESTABLISHED!! by vivek_an

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.