Re: The perfect solution / Re: Apache not behaving nicely with cdbi (#2)

[prev] [thread] [next] [Date index for 2005/02/15]

From: Andy Grundman
Subject: Re: The perfect solution / Re: Apache not behaving nicely with cdbi (#2)
Date: 17:33 on 15 Feb 2005
karjala_lists@xxxxxxx.xxx wrote:
> The perfect solution to the problem was here: 
> http://www.spanner.org/lists/cdbi/2004/11/15/7a69b2f1.html

I'm glad that worked for you.  For the record, I've since changed my app 
to only use the single $Class::DBI::Weaken_Is_Available = 0; line in the 
top module, so I don't have to worry about clearing the index in various 
places, and it's been working great for me ever since.  I am not using 
Mason, just Apache 1.3.33 and mp 1.27.

Once, I thought I found the source of my closure, in this code:

sub getDbh {
         my $self = shift;
         my ($dsn, $dbuser, $dbpass) = @_;

         my $dbh = "";
         if ($ENV{MOD_PERL} && !$Apache::ServerStarting) {
                 $dbh = Apache->request->pnotes('dbh');
         }
         if (!$dbh) {
                 my %options = $self->_default_attributes;
                 $options{PrintError} = 1;
this line ---->  my $dbh = DBI->connect_cached($dsn, $dbuser, $dbpass, 
\%options) or die $@;
                 if ($ENV{MOD_PERL} && !$Apache::ServerStarting) {
                         Apache->request->pnotes('dbh', $dbh);
                 }
         }
         return $dbh;
}

I was creating a local $dbh and then storing it in the pnotes, so I 
thought maybe that was my closure.  But I've since fixed that by 
removing the "my" on the line in question and tried re-enabling the 
index, but I still had problems.

-Andy

Apache not behaving nicely with cdbi (#2)
karjala_lists 07:27 on 15 Feb 2005

Re: Apache not behaving nicely with cdbi (#2)
karjala_lists 07:37 on 15 Feb 2005

Re: Apache not behaving nicely with cdbi (#2)
Perrin Harkins 14:38 on 15 Feb 2005

Re: Apache not behaving nicely with cdbi (#2)
karjala_lists 16:35 on 15 Feb 2005

Re: The perfect solution / Re: Apache not behaving nicely with cdbi (#2)
Andy Grundman 17:33 on 15 Feb 2005

Re: Apache not behaving nicely with cdbi (#2)
Perrin Harkins 18:32 on 15 Feb 2005

Re: Apache not behaving nicely with cdbi (#2)
karjala_lists 07:14 on 16 Feb 2005

Re: Apache not behaving nicely with cdbi (#2)
Perrin Harkins 13:36 on 16 Feb 2005

Generated at 11:20 on 20 Feb 2005 by mariachi v0.52