Re: [CDBI] Prepared statement handle error under mod_perl

[prev] [thread] [next] [Date index for 2006/01/19]

From: Tim Bunce
Subject: Re: [CDBI] Prepared statement handle error under mod_perl
Date: 10:41 on 19 Jan 2006
On Wed, Jan 18, 2006 at 10:44:40PM -0800, Ryan Tate wrote:
> On 1/18/06, Perrin Harkins <perrin@xxxx.xxx> wrote:
> >Try disabling MySQL's auto-reconnect feature.
> 
> Thanks for this, it sounds promising. I have it disabled but of course
> I need some hours before I know if it worked ;->
> 
> I may submit a DBD::mysql doc patch -- it works in the \%attrs
> argument to DBI->connect (i.e. {RaiseError => 1, mysql_auto_reconnect
> => 0}) but not in the dsn, which could be made clearer (especially
> since mysql_use_result works this way).
> 
> I also vaguely wonder if DBD::mysql or DBI could handle this whole
> thing more gracefully -- one would think an sth cached by
> prepare_cached would be cleared out on reconnect if the reconnect is
> going to spoil the sth. But that's way beyond the scope of this list.

Yes, auto-reconnect should clear $dbh->{CachedKids}. (That won't deal with
any $sth being used by the application code, but that's a different problem).

But auto-reconnect is (IMHO) a bad idea for all but the most trivial of
applications.

Tim.

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

Re: [CDBI] Prepared statement handle error under mod_perl
Tim Bunce 10:41 on 19 Jan 2006

Generated at 09:31 on 23 Jan 2006 by mariachi v0.52