http://www.perlmonks.org?node_id=497302


in reply to Class::DBI::AbstractSearch and SpeedyCGI

I've been seeing the same problem using Apache/HTML::Mason/mod_perl/Class::DBI/MySQL on Mac OS X, and have had similar trouble diagnosing exactly what the problem is. I'm not using Speedy, so this bug isn't specific to that choice. Nor am I using AbstractSearch.

Since the current platform I'm working on isn't what I'm going to deploy on, I've been mostly ignoring this, hoping that moving to my deployment platform and upgrading Class:DBI etc would fix this.

It feels like a bug in Class::DBI v0.96 to me. My experience is that it happens when there are multiple concurrent MySQL requests; I'm more likely to see the problem when the server gets busy. It's very frustating when Class::DBI just crashes rather than reporting an error or retrying. But as I say, I haven't tracked down the root cause.

If you do figure out what the fix is, I'd be very interested to know.

Update:
Just installed most recent Class::DBI, which is 3.0.1. Now that I see how old the version I was I was using, I'll have to do some more testing and see what it looks like now.

Yet another update.
Now that I see my error again (3.0.1 didn't help), I'm not so sure it is the same problem as yours. Mine is reported from DBD::mysql :

DBD::mysql::st fetchrow_array failed: fetch() without execute() [for Statement "SELECT active, name, directory, start\nFROM Course\nWHERE id=?\n"] at /Library/Perl/5.8.6/DBIx/ContextualFetch.pm line 87.\n
I seem to remember something related along the lines of yours, but can't find it now.

Replies are listed 'Best First'.
Re^2: Class::DBI::AbstractSearch and SpeedyCGI
by zigdon (Deacon) on Oct 04, 2005 at 20:11 UTC
    I've seen such errors only when the script lost it's handle to the DB... Since I have it verify at the beginning of processing that the handle is still valid, reloading always seems to solve that issue for me.

    -- zigdon