> I'm having similar problems, but we think it's directly related to
> Oracle.  Basically, a connection is made to the Oracle database, a
> transaction is started and finished, but the connection to the
> database doesn't go away and the statement (at least from the oracle
> side) never seems to finish.  The data is present in the database
> (these are insert statement, btw).  Over time, every process collects
> one of these hanging statements and it eventually overwhelms our
> oracle database.  The only solution is to restart apache every 5
> minutes to eliminate the built-up non-finished transactions.

Yeah... two things: CONCURRENCY and TRANSACTIONS.

Concurrency: Are there any other processes/reports/queries running at the
time of insert?  That will lock ALL of them, waiting for the insert to
complete so the lock is released.  Or, Another Interesting Way To Lock A
Really Buff Linux Server (tm).

Transactions: how's this one for fun?  I started experimenting with
Apache::Session::Oracle to see what I could see.  Usually I run w/
$dbh->{AutoCommit} = 1, which is the default, because most of the time I'm
just running SELECT's.  But ::Oracle wouldn't ever complete the transaction,
hanging that server process and eventually most of the httpd system, all
waiting for the commit() on the INSERT (from the new Session) that doesn't
complete. <sigh> I ended up having to do a local block, with Commit => 1:

{
    local $dbh->{AutoCommit} = 0;
    tie %session, 'Apache::Session::Oracle', $session_id, { Handle => $dbh,
Commit => 1};
    $session_id = $session{_session_id}; # save a copy

    _set_cookie( $r, SESSION_COOKIE, $session{_session_id} );

    $session{referer} ||= $referer; # preserve prior entries

    untie %session;
}

HTH!

L8r,
Rob

Reply via email to