Re: Closing DB handler with PerlCleanupHandler

2004-11-10 Thread Perrin Harkins
On Wed, 2004-11-10 at 02:37, Batara Kesuma wrote: > > Also, why do you want to avoid persistent connections? > > Because the DB is running out of memory just to keep the persistent > connections, I just want to try it without persistent connections and > see the result. If the overhead is not too

Re: Closing DB handler with PerlCleanupHandler

2004-11-10 Thread Timour Ezeev
On Wed, 10 Nov 2004, Batara Kesuma wrote: [...] ## httpd.conf SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders PerlCleanupHandler MyApache::Cleanup Options +ExecCGI ## MyApache::Cleanup.pm package MyApache::Cleanup; use strict; sub handler { my ($r) =

Re: Closing DB handler with PerlCleanupHandler

2004-11-10 Thread Glenn Strauss
On Wed, Nov 10, 2004 at 12:51:56PM +0900, Batara Kesuma wrote: > Hi Stas, > > > 1) use Apache::DBI > > > > 2) if not, refer to: > > http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlCleanupHandler > > http://perl.apache.org/docs/2.0/user/coding/coding.html#Getting_the_C__r__Object > >

Re: Closing DB handler with PerlCleanupHandler

2004-11-09 Thread Batara Kesuma
Hi Perrin, > It looks to me like you are creating this problem by using "our". Why > > not use "my" and pass the handle around, or put it somewhere like > $r->pnotes() instead? Yes I should have used 'my' and passed the handle around :( > Also, why do you want to avoid persistent connections?

Re: Closing DB handler with PerlCleanupHandler

2004-11-09 Thread Perrin Harkins
Batara Kesuma wrote: But I have a problem here, because I use 'our' on $dbh so other functions can use it. It looks like: --- sub show_name { our $dbh; my $sth = $dbh->prepare("SELECT name FROM member WHERE id=?"); $sth->execute(1); ... } ## MAIN my $mn = MyPackage::Main::->new(); our $dbh

Re: Closing DB handler with PerlCleanupHandler

2004-11-09 Thread Stas Bekman
Batara Kesuma wrote: Hi Stas, 1) use Apache::DBI 2) if not, refer to: http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlCleanupHandler http://perl.apache.org/docs/2.0/user/coding/coding.html#Getting_the_C__r__Object Thank you for the answer. I tried to use Apache::DBI with dbi_connect_m

Re: Closing DB handler with PerlCleanupHandler

2004-11-09 Thread Batara Kesuma
Hi Stas, > 1) use Apache::DBI > > 2) if not, refer to: > http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlCleanupHandler > http://perl.apache.org/docs/2.0/user/coding/coding.html#Getting_the_C__r__Object Thank you for the answer. I tried to use Apache::DBI with dbi_connect_method =>

Re: Closing DB handler with PerlCleanupHandler

2004-11-09 Thread Stas Bekman
Batara Kesuma wrote: Hi, How can I pass $dbh value from PerlResponseHandler to PerlCleanupHandler to be disconnected? My scripts are running in ModPerl::Registry, and I don't want to do $dbh->disconnect() at the end of every scripts. So I try to write a module in PerlCleanupHandler to clean up the

Closing DB handler with PerlCleanupHandler

2004-11-09 Thread Batara Kesuma
Hi, How can I pass $dbh value from PerlResponseHandler to PerlCleanupHandler to be disconnected? My scripts are running in ModPerl::Registry, and I don't want to do $dbh->disconnect() at the end of every scripts. So I try to write a module in PerlCleanupHandler to clean up the DB handler at the en