Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Weird Apache/DBI problems

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


t at funkreich

Dec 22, 2005, 7:00 AM

Post #1 of 4 (611 views)
Permalink
Weird Apache/DBI problems

Hi list,

I recently transferred our application to a more powerful server running
debian 3.1. As always I compiled the important parts (perl 5.8.7 without
threads and apache 1.3.34/mod_perl plus a lot of cpan modules) myself. Our
application (which uses Mason) ran fine for the last 3 years on all kinds
of setups (including debian 3.1) but on the new machine the apache is currently
running wild.
As soon as more than one parallel request is made I immediately get
unexplainable DBI errors like "fetch() without execute()", "DBD driver
has not implemented the AutoCommit attribute" or "Commands out of sync;
you can't run this command now". These messages do not appear when running
httpd in single-server mode (-X). I have removed debian's apache and cpan
packages and recompiled everything - but that didn't help either. So far
I've tried a MySQL 5.0 binary from mysql.com and the 4.1.11 one provided
by debian.

Any idea on what could cause this or where to look for more information
is greatly appreciated!

Thanks a lot!

Toby


---------------------------------------------------
email services provided by http://www.funkreich.de


perrin at elem

Dec 22, 2005, 7:17 AM

Post #2 of 4 (574 views)
Permalink
Re: Weird Apache/DBI problems [In reply to]

On Thu, 2005-12-22 at 16:00 +0100, Tobias wrote:
> As soon as more than one parallel request is made I immediately get
> unexplainable DBI errors like "fetch() without execute()", "DBD driver
> has not implemented the AutoCommit attribute" or "Commands out of sync;
> you can't run this command now". These messages do not appear when running
> httpd in single-server mode (-X).

Most likely you are making a DBI connection during startup, putting it
in a global, and using it from multiple child processes. If you have
this system running safely on another machine, figuring out what code
you changed is a good place to start. Apache::DBI tries to prevent
this, but it can't stop you from putting a $dbh into a global yourself.

- Perrin


t at funkreich

Dec 22, 2005, 7:28 AM

Post #3 of 4 (569 views)
Permalink
Re: Weird Apache/DBI problems [In reply to]

Zitat von Perrin Harkins <perrin [at] elem>:

> On Thu, 2005-12-22 at 16:00 +0100, Tobias wrote:
> > As soon as more than one parallel request is made I immediately get
> > unexplainable DBI errors like "fetch() without execute()", "DBD driver
> > has not implemented the AutoCommit attribute" or "Commands out of sync;
> > you can't run this command now". These messages do not appear when running
> > httpd in single-server mode (-X).
>
> Most likely you are making a DBI connection during startup, putting it
> in a global, and using it from multiple child processes. If you have
> this system running safely on another machine, figuring out what code
> you changed is a good place to start. Apache::DBI tries to prevent
> this, but it can't stop you from putting a $dbh into a global yourself.

I'm establishing a database connection in my mod_perl handler sub routine
making it globally available using Mason's allow_globals feature. That
always worked for me (until now :))

The weird thing is that I just rsync'd the code over from another debian
system on which the application runs just fine. The only difference
(as far as I can see) to the failing system is a debian Perl 5.8.4 (with
threads) instead of a self-compiled threadless Perl 5.8.7. Any other ideas?
Thanks again for your help!

Toby

---------------------------------------------------
email services provided by http://www.funkreich.de


perrin at elem

Dec 22, 2005, 7:48 AM

Post #4 of 4 (561 views)
Permalink
Re: Weird Apache/DBI problems [In reply to]

On Thu, 2005-12-22 at 16:28 +0100, Tobias wrote:
> The weird thing is that I just rsync'd the code over from another debian
> system on which the application runs just fine. The only difference
> (as far as I can see) to the failing system is a debian Perl 5.8.4 (with
> threads) instead of a self-compiled threadless Perl 5.8.7. Any other ideas?

Did you install the exact same versions of Mason and all other CPAN
modules that the working system has? If not, that is a likely source of
the problem. Another possibility is that you accidentally compiled DBI
with a different perl from the one you compiled mod_perl with.

- Perrin

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.