Re: DBD::mysql::st execute warning
[prev]
[thread]
[next]
[Date index for 2005/01/03]
On Mon, 2005-01-03 at 01:51 +0000, Scott McWhirter wrote:
> I've come across this recently and the
> main fix is to implement a "ping" subroutine since mysql doesn't
> implement one itself.
According to the ChangeLog, MySQL has had a ping subroutine for
something like 6 years. You should not implement your own.
> Also things like caching statement handles without
> using "prepare_cached" is a very bad thing.
It looks like Ima::DBI does the right thing there, calling
prepare_cached() each time you ask for the handle. The symptoms though
point to a cached statement handle that tries to use a database
connection that has gone away.
> In the main, it looks more like a DBI/DBD problem rather than a
> Class::DBI one.
I don't think so. DBI/DBD::mysql do the right thing when you call
connect_cached() and prepare_cached(), so this most likely is caused by
a statement handle getting kept around someplace in Ima::DBI or
Class::DBI.
I'd suggest a bit more debugging by manually dropping and restarting the
mysql server after a few requests, and seeing if it can pick up
correctly. It's probably a good idea to add some extra debugging into
the Ima::DBI code to see if it is calling the right things (doing the
ping and prepare_cached) in the request where you have the problem.
- Perrin