[Lxr-dev] DB connection bug
Brought to you by:
ajlittoz
|
From: Malcolm B. <ma...@br...> - 2001-08-04 14:46:13
|
Kevin Way wrote:
> Any chance you've made progress on the DB connection bug?
I have a possible fix that I'm testing out at the moment with Mysql.pm
(I don't have Postgres installed yet). This is to make the $dbh handle
local to each Mysql object ie $self->{dbh} rather than a package
variable. I've also made all the sql statements object variables rather
than package ones.
This then lets the connection be closed via a DESTROY subroutine
whenever the index object goes out of scope. I think this is a nice
solution since I can't find any guarantee on the ordering of END blocks
between packages which Peder has pointed out could cause the problem.
I plan to test this change for a bit here and then release it if it
continues to work.
I imagine a similar approach would work for Postgres as well.
Cheers,
Malcolm
|