[CDBI] Prepared statement handle error under mod_perl

Ryan Tate lists at ryantate.com
Wed Jan 18 23:35:59 GMT 2006

This is a fairly vague error report, but I have seen a lot of talk
lately on the list about prepare_cached and DBIx::ContextualFetch, so
I thought I'd ask it now even if the details are a bit sketchy, since
those topics are (theoretically) fresh in peoples' minds.

I run CDBI 0.96 under mod_perl2, DBI 1.48, DBIx::ContextualFetch 1.02,
and one of the first DBD::mysql's to support true prepared statements

Since the DBD::mysql upgrade to true prepared statements, when I
switch one of my CDBI Web apps from CGI mode to mod_perl (persistent),
I will get the following sort of error whenever the app has been out
of use for several hours (just me using it at moment):

DBD::mysql::st execute failed: Unknown prepared statement handler (11)
given to mysql_stmt_execute [for Statement "(SQL cut here)"] at
/usr/local/share/perl/5.8.4/DBIx/ContextualFetch. pm line 51.

You can keep reloading but it doesn't make the error go away. I have
to restart the webserver, which fixes things.

I checked, and the sth that is triggering this (I can tell from the
SQL dump) is properly ->finished in my code.

Line 51 of Contextual Fetch is calling execute on the (obviously cached) sth.

Anyone know what's happening before I start banging my head against
this? Thanks for any help.

More information about the ClassDBI mailing list