Thanks again for the varied responses.
My main concern right now is to get this thing running reliably with minimum
hassle. I've not had any connection related problems aprt from this "set names"
related stuff. For now I'll take the minor hit of an extra query per request and
issue "set names" eve
Adam Worrall wrote:
I ended up hacking Apache::DBI to place the $conn into a @global, to
prevent DESTROY from kicking in. Naughty resource leaks ahoy.
The moral: it's surprisingly hard to get all this stuff working well !
Could maybe attach a diff ?
--
END
On Fri, 2005-11-04 at 12:33 -0500, Malcolm J Harwood wrote:
> Not always though. Something I've run into (but had problems tracking down
> the
> cause) is that if the db server is rebooted between requests, Apache::DBI can
> think it's still got a valid handle and the db doesn't.
The check is o
On Friday 04 November 2005 12:14 pm, Perrin Harkins wrote:
> Apache::DBI checks the handle to make sure it is still connected before
> handing it back to you. If it has been disconnected, a new connection
> will be made.
Not always though. Something I've run into (but had problems tracking dow
On Fri, 2005-11-04 at 11:53 -0500, Philip M. Gollucci wrote:
> > But I can't help feeling I'm redesigning the wheel here - would I have the
> > same
> > problem if I used Apache::DBI? Are there other easier ways to handle this?
> IIRC, Apache::DBI just makes the connection persistant. It could st
You could also just make sure something like the following is in a my.cnf file (on my system it's /var/lib/mysql/my.cnf):
[perl]
default-character-set=utf8
And then when you connect, you'll need to specify two options to DBI to make DBD::mysql read from the option file:
DBI->connect( 'dbi:mysql:lo
But I can't help feeling I'm redesigning the wheel here - would I have the same
problem if I used Apache::DBI? Are there other easier ways to handle this?
IIRC, Apache::DBI just makes the connection persistant. It could still
time out and disconnect if a handle in the handle cache isn't used. A
On Fri, 2005-11-04 at 13:34 +, Daniel McBrearty wrote:
> It seems the problem is caused by the connection timing out, after which it
> automatically reconnects - but set names is not then done. (I am not using
> Apache::DBI.)
>
> Possible solutions:
> - modify code to issue set names at the s
Thanks to those who responded to me privately.
It seems the problem is caused by the connection timing out, after which it
automatically reconnects - but set names is not then done. (I am not using
Apache::DBI.)
Possible solutions:
- modify code to issue set names at the start of every request (