Added comparison check where DSN eq site's DSN then just reuse the connection.

This commit is contained in:
JT Smith 2002-11-06 03:40:15 +00:00
parent 004765e088
commit f1a1a73fa7

View file

@ -108,7 +108,9 @@ sub www_view {
$output = $_[0]->displayTitle;
$output .= $_[0]->description;
$output .= WebGUI::International::get(17,$namespace)." ".$query."<p>" if ($_[0]->get("debugMode"));
if ($dsn =~ /\DBI\:\w+\:\w+/) {
if ($dsn eq $session{config}{dsn}) {
$dbh = $session{dbh};
} elsif ($dsn =~ /\DBI\:\w+\:\w+/) {
eval{$dbh = DBI->connect($dsn,$_[0]->get("username"),$_[0]->get("identifier"))};
if ($@) {
WebGUI::ErrorHandler::warn("SQL Report [".$_[0]->get("wobjectId")."] ".$@);