perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Rorabaugh" <troraba...@capwiz.com>
Subject Hanging Apache && Oracle Sessions with Apache::DBI, Apache::SessionManager, Oracle 9i,
Date Tue, 07 Dec 2004 16:05:43 GMT
Dear mod_perl list,
 
Normally I would not bother the mod_perl list with 
questions but I have a problem with Apache::DBI, Apache::SessionManager
and Apache::Sessions
regarding hanging oracle sessions.
 
I have noticed within the 
Apache::Session::Store::Oracle module that it uses a 
SELECT a_session FROM sessions WHERE id = ? FOR UPDATE
 
If a user clicks the stop button in their browser during a process (IE
during a session update or setting the session) and then clicks another
link
this will sometimes cause apache to hang and the user must restart their
browser. This will also cause the previous update 
(UPDATE sessions SET a_session = ? WHERE id = ?) Oracle session to hang
within Oracle. Has anyone else on the list seen this problem?
 
Version Numbers: 
mod_perl 1.27
Apache::DBI 0.88
Apache::SessionManager = 1.01
Apache::Session 1.54
DBI 1.40
DBD::Oracle 1.12
 
 
Current httpd.conf Apache::SessionManager setup
 
PerlModule Apache::DBI
PerlRequire conf/startup.pl

#oracle client environment variables
SetEnv ORACLE_BASE /path/to/o01/oracle/app
SetEnv ORACLE_HOME /path/to/o01/oracle/app
SetEnv LD_LIBRARY_PATH /path/to/o01/oracle/app/lib

PerlSetEnv ORACLE_HOME /path/to/o01/oracle/app
PerlModule Apache::SessionManager
PerlTransHandler Apache::SessionManager
 
<LocationMatch /.*/somedirectory/.*>
PerlSetVar SessionManagerTracking On
#PerlSetVar SessionManagerURITracking On
PerlSetVar SessionManagerExpire 3600
PerlSetVar SessionManagerInactivity 900
PerlSetVar SessionManagerName SESSID
PerlSetVar SessionManagerCookieArgs "Path   => /, Domain =>
subdomain.mydomain.com"
PerlSetVar SessionManagerStore Oracle
PerlSetVar SessionManagerStoreArgs "DataSource => dbi:Oracle:mydb,
UserName  => *, Password   => *, LongReadLen => 24576, Commit => 1"
PerlSetVar SessionManagerDebug 9
PerlSetVar SessionManagerSetEnv On
</LocationMatch>

<Location /perl-status>
SetHandler  perl-script
PerlHandler Apache::Status
PerlSetVar StatusOptionsAll On
</Location>

 
Inside the mod_perl application
 
$self->{session} = new Apache::SessionManager($r);
 
sub getSessionParam {
    my $self = shift;
    my $param = shift;
    return undef unless($param);
    my $s = $self->{session};
    my ($sparam) = $s->get_session_param($self->client_name);
    if(defined $sparam->{$param}) {
        return $sparam->{$param};
    } else {
        return undef;
    }
}

sub setSessionParam {
    my $self = shift;
    my $param = shift;
    my $value = shift;
    return undef unless($param && $value);
    my $s = $self->{session};
    my  ($sparam) = $s->get_session_param($self->client_name);
    $sparam->{$param} = $value;
    $s->set_session_param($self->client_name, $sparam);
    return $sparam;
}
 
Last question
 
Apache::DBI->setPingTimeOut($data_source, $timeout)
 
       This configures the usage of the ping method, to validate a
connection.
       Setting the timeout to 0 will always validate the database
connection
       using the ping method (default). Setting the timeout < 0 will
de-acti-
       vate the validation of the database handle. This can be used for
       drivers, which do not implement the ping-method. Setting the
timeout >
       0 will ping the database only if the last access was more than
timeout
       seconds before.

 
 
Any help would be appreciated 
 
Sincerely Yours,
Tyler Rorabaugh
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mime
View raw message