sub _new
{ my ($self, @param) = @_;
$self->SUPER::_new(@param); } |
sub getRegistryXML
{
my $self=shift;
my $dbh=$self->dbh();
my $dsn=$self->dsn();
unless ($dbh) {
warn("\n\nWARNING: Could not load Registry from database $dsn, SKIPPING\n\n");
return undef;
}
$dbh->{'LongTruncOk'} = 1;
$dbh->{'LongReadLen'} = 20000;
my $sql = "SELECT compressed_xml FROM ".$self->schema.".meta_registry";
my $sth = $dbh->prepare($sql);
unless ($sth) {
my $err = $dbh->errstr;
$dbh->disconnect;
BioMart::Exception::Database->throw("Could not prepare statement handle for registry fetch for db $dsn: $err");
}
my $executed = $sth->execute;
unless ($executed) {
my $err = $dbh->errstr;
$sth->finish;
$dbh->disconnect;
BioMart::Exception::Database->throw("Could not execute sql for $dsn: $err");
}
my $row = $sth->fetchrow_arrayref;
my $xml = Compress::Zlib::memGunzip($row->[0]) ;
$sth->finish;
$dbh->disconnect;
return $xml;
}
1; } |