From 40950bba64ccd3ae78830addb2c59ed31ae20694 Mon Sep 17 00:00:00 2001 From: Web Admin <w3adm@sanger.ac.uk> Date: Wed, 24 Nov 2004 16:42:06 +0000 Subject: [PATCH] fixed db_handle calling connect when connect calls dbhandle --- modules/Bio/EnsEMBL/DBSQL/DBConnection.pm | 24 ++--------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm b/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm index 03922294e4..8c4213bf6d 100644 --- a/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm +++ b/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm @@ -151,24 +151,6 @@ sub new { $self->port($port); $self->driver($driver); - -# $self->connect(); - - -# if($species){ -# print "setting species to $species\n"; -# Bio::EnsEMBL::Registry->add_alias($species,$species); -# $self->species($species); -## print "setting species to $species\n"; -# } -# else{ -# throw("No species specified\n"); -# } -# if($group){ -# $self->group($group); -# } - - if($inactive_disconnect) { $self->disconnect_when_inactive($inactive_disconnect); } @@ -208,9 +190,7 @@ sub connect { ";port=" . $self->port(); my $dbh; - eval{ - $dbh = DBI->connect($dsn, $self->username(), $self->password(), {'RaiseError' => 1}); - }; + eval{ $dbh = DBI->connect($dsn, $self->username(), $self->password(), {'RaiseError' => 1}); }; if(!$dbh || $@ || !$dbh->ping()) { warn("Could not connect to database " . $self->dbname() . @@ -533,7 +513,7 @@ sub db_handle { return $self->{'db_handle'.$$} = shift if(@_); return $self->{'db_handle'.$$} if($self->connected); - $self->connect(); +# $self->connect(); return $self->{'db_handle'.$$}; } -- GitLab