Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 13724 invoked from network); 31 May 2007 16:26:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 May 2007 16:26:55 -0000 Received: (qmail 94687 invoked by uid 500); 31 May 2007 16:26:51 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 94672 invoked by uid 500); 31 May 2007 16:26:51 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 94660 invoked by uid 99); 31 May 2007 16:26:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 May 2007 09:26:51 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [208.97.132.83] (HELO swarthymail-a4.g.dreamhost.com) (208.97.132.83) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 May 2007 09:26:45 -0700 Received: from [192.168.1.100] (user-1087kaq.cable.mindspring.com [64.131.209.90]) by swarthymail-a4.g.dreamhost.com (Postfix) with ESMTP id 1A14A129A96; Thu, 31 May 2007 09:26:23 -0700 (PDT) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: "mod_perl mod_perl" Content-Transfer-Encoding: 7bit From: Jonathan Vanasco Subject: Re: mod_perl forking and DBD::Pg prepared statement problem Date: Thu, 31 May 2007 12:27:02 -0400 To: Aaron Trevena X-Mailer: Apple Mail (2.752.2) X-Virus-Checked: Checked by ClamAV on apache.org aaron- I think this may be more of a Maypole design issue than a mod_perl issue -- although there may also be a bit of an application design issue on your part ( which some of your wording suggests ) , and there may be a dbd::pg issue as well. my input: 1: potential issue in your application: you should be using a startup.pl file to preload the maypole files and your appplication files. that will compile everything on startup. i'm assuming you're not doing that already , because of some wording in your text -- you should be trying to compile everything into apache yourself, not worrying about virtualhosts or apachemain sections. 2: potential issue with maypole / apache your setup might be preparing the statements before the fork . maybe you're using apache::dbi and doing an outright connect, not a connect on init ? or using a global db connection? make sure that you don't connect at all, or do a forceful disconnect on your db handles before you fork, so each apache child has a fresh db connection for itself. newer versions of apache::dbi should do this already, but it doesn't hurt to force it to disconnect ( disconnect is overloaded, so $dbh- >disconnect doesn't work, you need to DBI::Whatever::disconnect ( $dbh ) ) 3: potential issue with dbd::pg / dbi in 1.48(?) there was some issue with the way that prepared statments were cached. i think the fix was to simply include the PID of the process that created them. i'm a bit confused on the whole topic, because there was a lot of blame going back and forth about a year ago -- dbi said it was the dbd problem, dbd said it was an apache::dbi problem, apache::dbi said it was a user config problem. eventually most things got patched to circumvent the situation from happening. make sure you're up to date i hope that helps. On May 31, 2007, at 11:32 AM, Aaron Trevena wrote: > Hello you wonderful helpful people :) > > I've just moved a web application (maypole/c::dbi) from one > development server to another, previously the code worked fine but now > I get : > > 'prepared statement "dbdpg_1" does not exist' on every (prepared) > query to the database. > > There only are two differences: the version of postgres and the apache > configuration - other than that the dependancies all match. > > On the problem server the perl content handler is in a location > outside of a virtual host, in the working server is in a location > inside a virtual host. > > The problem server also has postgres 8.1 and the working server has > postgres 7.4 - this shouldn't make any difference (although 8.1 is > backwards incompatible enough to have caused problems previously with > querys no longer being valid *sigh*). > > So my question is - will having a content handler in a location > directive outside of virtual host cause it to be compiled before > forking, and after forking if inside a virtual host? As pre-forking > seems to be blamed in the few examples I could find with google. // Jonathan Vanasco | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | SyndiClick.com | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | FindMeOn.com - The cure for Multiple Web Personality Disorder | Web Identity Management and 3D Social Networking | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | RoadSound.com - Tools For Bands, Stuff For Fans | Collaborative Online Management And Syndication Tools | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -