D
david
Hi all,
I have an application that i want to move to mod_perl.
My problem is that under the application i have a class variable that
makes caching of the database handler of dbi
This is how the class looks like
package Connection;
use DBI;
my $dbh;
sub instance {
if (!$dbh) {
$dbh = DBI->new;
}
return $dbh;
}
Before it was nice, because if in the same request i wanted to get
more than one connection it returned me the same.
But here in mod_perl i get for different requests the same dbh and the
application relies that it won't be the connection. For example, i
create temporary tables that are deleted automatically after each
request, because the connection expires, but now not.
What is the solution for this problem ?
Thanks in advance,
David
I have an application that i want to move to mod_perl.
My problem is that under the application i have a class variable that
makes caching of the database handler of dbi
This is how the class looks like
package Connection;
use DBI;
my $dbh;
sub instance {
if (!$dbh) {
$dbh = DBI->new;
}
return $dbh;
}
Before it was nice, because if in the same request i wanted to get
more than one connection it returned me the same.
But here in mod_perl i get for different requests the same dbh and the
application relies that it won't be the connection. For example, i
create temporary tables that are deleted automatically after each
request, because the connection expires, but now not.
What is the solution for this problem ?
Thanks in advance,
David