Re: DBI Errors When Using Maypole

[prev] [thread] [next] [Date index for 2004/07/27]

From: Tim Bunce
Subject: Re: DBI Errors When Using Maypole
Date: 18:05 on 27 Jul 2004
On Tue, Jul 27, 2004 at 10:13:00AM +0100, a.campbell@xxxxxxxxxxx.xxx wrote:
> I had a similar problem. My guess as to whats happening is that Ima::DBI connect_cach method, does not function as you'd imagine under mod_perl. So when you make a call, it actual pulls out an active statement handler. The failure is in Ima::DBI if I remember correctly something along the lines of $sth->active() .
> 
> My solution was within Ima::DBI, altering the function _mk_db_closure 
> and using Apache::DBI to cache my handles. Not very elegant, but well it got it working.
> 
>  return sub {
>                 if ( $ENV{'MOD_PERL'} ){
>                         $dbh = DBI->connect(@connection);
>                 }
>                 else {
>                         unless ($dbh && $dbh->FETCH('Active') && $dbh->ping) {
>                                 $dbh = DBI->connect_cached(@connection);
>                         }
>                 }
>                 return $dbh;

I've not followed this thread - but the above should not be required.
DBI 1.40 changes include:

  Changed connect_cached() when running under Apache::DBI
    to route calls to Apache::DBI::connect().

Tim.

DBI Errors When Using Maypole
Robert James Kaes 17:44 on 26 Jul 2004

Re: DBI Errors When Using Maypole
a.campbell 09:13 on 27 Jul 2004

Re: DBI Errors When Using Maypole
Tim Bunce 18:05 on 27 Jul 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52