Hi, when using Apache::DBI, it keeps re-connecting even though the database
and user is the same:

I am using ApacheDBI-0.87, DBD-Oracle-1.06, DBI-1.14, perl5.6.0 on an 8.1.5
Oracle database (perl -v & -V further below)

My httpd.conf is setup as:
 PerlModule      Apache::DBI Apache Apache::Registry Apache::XPP CGI
 PerlInitHandler Apache::Reload
 PerlSetVar      ReloadAll Off
 PerlSetVar      XPPIncludeDir /opt/www/icl/htdocs/include
 PerlSendHeader  On

I have an XPP perl script which uses one of my own perl modules to connect
to a database.
This works fine and I was able to both Connect & Disconnect as expected
before using Apache::DBI

When calling the XPP script multiple times using Apache::DBI (using the same
username & password) as you can see, it connects twice - leaving an oracle
process running for each connection. 

447 Apache::DBI             push PerlCleanupHandler 
447 Apache::DBI             need ping: yes
447 Apache::DBI             new connect to
'PVCSNMPR_RPTNMPR_RPTPrintError=0RaiseError=0AutoCommit=0'
447 Apache::DBI             disconnect (overloaded) 
447 Apache::DBI             PerlCleanupHandler 
447 Apache::DBI             PerlCleanupHandler rollback for
PVCSNMPR_RPTNMPR_RPTPrintError=0RaiseError=0AutoCommit=0 

450 Apache::DBI             push PerlCleanupHandler 
450 Apache::DBI             need ping: yes
450 Apache::DBI             new connect to
'PVCSNMPR_RPTNMPR_RPTPrintError=0RaiseError=0AutoCommit=0'
450 Apache::DBI             disconnect (overloaded) 
450 Apache::DBI             PerlCleanupHandler 
450 Apache::DBI             PerlCleanupHandler rollback for
PVCSNMPR_RPTNMPR_RPTPrintError=0RaiseError=0AutoCommit=0 

450 Apache::DBI             disconnect (overloaded) 
450 Apache::DBI             push PerlCleanupHandler 
450 Apache::DBI             need ping: yes
450 Apache::DBI             already connected to
'PVCSNMPR_RPTNMPR_RPTPrintError=0RaiseError=0AutoCommit=0'
450 Apache::DBI             disconnect (overloaded) 
450 Apache::DBI             PerlCleanupHandler 
450 Apache::DBI             PerlCleanupHandler rollback for
PVCSNMPR_RPTNMPR_RPTPrintError=0RaiseError=0AutoCommit=0

Would you happen to have any idea as to why this might be happening? I have
read/searched around everywhere but cant find any reason for this.  

What I have just noticed is that the reconnect works fine providing I access
the script with the same url.  My URL was changing due to different CGI
parameters that were being passed.  Does this make a difference? (perhaps
the request bit needs to somehow first be stripped off - though I would have
thought that it is totally independant of this, with Apache::DBI working on
the DBI level)

Many thanks

Roger Foskett 

----------------------------------------------------------------------------
 - output of perl -v,
v5.6.0 built for PA-RISC2.0

 - output of perl -V,
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC2.0
    uname='hp-ux titan b.11.00 u 9000800 103901567 unlimited-user license '
    config_args='-Ubincompat5005'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_HPUX_SOURCE -Aa -I/usr/local/include'
    ccflags =' +z -D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64  -Ae '
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lnm -lndbm -lgdbm -ldld -lm -lc -lndir -lcrypt -lsec -lcl
-lpthread
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='+z', lddlflags=' -b +vnocompatwarnings -L/usr/local/lib'

Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under hpux
  Compiled at Dec 19 2000 19:17:00
  @INC:
    /opt/www/perl5/lib/5.6.0/PA-RISC2.0
    /opt/www/perl5/lib/5.6.0
    /opt/www/perl5/lib/site_perl/5.6.0/PA-RISC2.0
    /opt/www/perl5/lib/site_perl/5.6.0
    /opt/www/perl5/lib/site_perl

Reply via email to