Foskett Roger wrote:
>
> 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.
is is supposed to make one connection per httpd.
>
> 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
ok, so there is one connect for the httpd with pid = 447
>
> 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
here is another connect for the httpd with pid = 450
>
> 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
this request is proccesed again by the httpd with pid = 450
and consequently it says: 'already connected to ...'
>
> 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
everything looks ok.
Edmund
--
http://www.edmund-mergl.de
fon: +49 700 edemergl