diff --git a/modules/Bio/EnsEMBL/DBSQL/OntologyTermAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/OntologyTermAdaptor.pm index c0b4b4a380a57c54c5aeef2ad12974a379246bc1..28bb493ae9a24c6cbf3926180087d92946f619eb 100644 --- a/modules/Bio/EnsEMBL/DBSQL/OntologyTermAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/OntologyTermAdaptor.pm @@ -242,6 +242,8 @@ WHERE relation.child_term_id = child_term.term_id push( @{ $term->{'children'}{$relation} }, $child_term ); } + $sth->finish(); + $term->{'child_terms_fetched'} = 1; } else { foreach my $relation ( values( %{ $term->{'children'} } ) ) { @@ -319,6 +321,8 @@ ORDER BY closure.distance, child_term.accession); ) ); } + $sth->finish(); + return \@terms; } ## end sub fetch_all_by_ancestor_term @@ -388,6 +392,8 @@ WHERE relation.child_term_id = ? push( @{ $term->{'parents'}{$relation} }, $parent_term ); } + $sth->finish(); + $term->{'parent_terms_fetched'} = 1; } else { foreach my $relation ( values( %{ $term->{'parents'} } ) ) { @@ -501,9 +507,13 @@ ORDER BY closure.distance, parent_term.accession); '-name' => $name, '-definition' => $definition, ) ); + } else { + last; } } + $sth->finish(); + return \@terms; } ## end sub fetch_all_by_descendant_term @@ -579,6 +589,8 @@ ORDER BY closure.distance); push( @{ $id_chart{$subparent_id}{$relation} }, $parent_id ); } + $sth->finish(); + my @terms = @{ $this->fetch_by_dbID_list( [ keys(%id_chart) ] ) }; foreach my $term (@terms) { @@ -696,6 +708,8 @@ WHERE ontology.ontology_id = term.ontology_id ) ); } + $sth->finish(); + return \@terms; } ## end sub fetch_by_dbID_list