You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by br...@dss.state.va.us on 2003/08/27 16:53:12 UTC

Apache::DBI not really loading

I've got a case where my DBI connections appear to be timing out and not
reconnecting.  Google just points to the old timeout problem that should
be solved.

I've set Apache::DBI::DEBUG to 2, and I'm not seeing _any_ messages
(from it) in the error log.  Apache::Status lists Apache DBI, but lists
no database connections.

Advice most welcome

Perl version v5.6.1 for Apache/1.3.27 (Unix) AuthPG/1.2 mod_perl/1.27

Database is Postgres  (I can dig up version, but it's recent but not most
recent)

I have no startup.pl (just trying to get it to work at this point)

Scripts are in /login, and call DBI->connect() and disconnect().  They
work, until the connection drops.  (Normally, it doesn't time out, but
the connection will eventually drop when the network fritzes, figure
once or twice a week.)  Then I get 
 DBD::Pg::st execute failed: no connection to the server at (my module)
in the error log.  It looks as if Apache::DBI isn't pinging it, but my
efforts to look into have just left me confused...Apache::DBI is loaded,
according to Apache::Status, But why won't it log any material?

httpd.conf looks like: (test server obviously)

MinSpareServers 1
MaxSpareServers 1
StartServers 1

<IfModule mod_perl.c>
  PerlTaintCheck On
  PerlWarn On
  PerlModule Apache::Status 
  PerlSetVar StatusOptionsAll On
  PerlSetVar StatusTerse On
  PerlSetVar StatusTerseSize On
  PerlSetVar StatusTerseSizeMainSummary On
  PerlModule B::TerseSize
  PerlModule Apache::DBI
  PerlModule Apache::StatINC
  PerlSetVar StatINC_Debug 1
<Location /perl-status>
  SetHandler perl-script
  PerlHandler Apache::Status
</Location>
<Location /login>
  PerlHandler Apache::Registry
  SetHandler perl-script
  Options +ExecCGI
</Location>
</IfModule>


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Apache::DBI not really loading

Posted by br...@dss.state.va.us.
> >I've set Apache::DBI::DEBUG to 2, and I'm not seeing _any_ messages
> >(from it) in the error log.  Apache::Status lists Apache DBI, but
> >lists no database connections.
>
> A long time ago, one problem used to be that if your connect to
> Postgres was idle for too long ( 8 hours ) the connection would
> timeout and give you these kinds of errors.  One solution was to make
> sure that you hit a web page that has such a connection periodically,

1) Wasn't this problem corrected by using the ping() method?  
2) I'm hoping for a clue why Apache::DBI is there but not giving any
messages or having any connections in Apache::Status
3) Avoiding timeout doesn't help when the network hiccups and drops
existing connections (I don't admin the network, can't change that)

> This may not be related to your current problem, so YMMV.

Doesn't appear helpful, but I appreciate some response :)



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Apache::DBI not really loading

Posted by Josh Chamas <jo...@chamas.com>.
brs900@dss.state.va.us wrote:
> I've got a case where my DBI connections appear to be timing out and not
> reconnecting.  Google just points to the old timeout problem that should
> be solved.
> 
> I've set Apache::DBI::DEBUG to 2, and I'm not seeing _any_ messages
> (from it) in the error log.  Apache::Status lists Apache DBI, but lists
> no database connections.
> 
> Advice most welcome
> 
> Perl version v5.6.1 for Apache/1.3.27 (Unix) AuthPG/1.2 mod_perl/1.27
> 
> Database is Postgres  (I can dig up version, but it's recent but not most
> recent)

A long time ago, one problem used to be that if your connect to Postgres
was idle for too long ( 8 hours ) the connection would timeout and give
you these kinds of errors.  One solution was to make sure that you hit a web page
that has such a connection periodically, so that you keep the connection
to the database active, just run in your cron an lwp-request ping to
the web page in question and you should be fine.

This may not be related to your current problem, so YMMV.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checker                 http://www.nodeworks.com



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html