[ensembl-dev] Clean disconnection for db
Andy Yates
ayates at ebi.ac.uk
Fri Sep 10 10:02:06 BST 2010
Both will have the same impact since they loop through all DBAdaptors which are in the registry & issue a disconnect. The only difference is that issuing a
Bio::EnsEMBL::Registry->disconnect_all();
Loops through & disconnecting if the connection was idle.
Bio::EnsEMBL::Registry->clear();
Gets the db_handle() & forces a close on it ignoring what is going on at that point in time (if you were in the middle of a logical call to the DB) and also resets the registry.
The way you load your Registry has no bearing on the disconnect/clear method.
Andy
On 10 Sep 2010, at 08:33, Sébastien Moretti wrote:
> Le 10/09/2010 09:11, Sébastien Moretti a écrit :
>> Okay, I will use disconnect_all() by default.
>>
>> But does disconnect_all() or clean() have an impact on registry when
>> defined this way ?
>>
>> my $reg = 'Bio::EnsEMBL::Registry';
>> $reg->load_registry_from_db(
>> -host => $connection_param->{'host'},
>> -port => $connection_param->{'port'},
>> -user => $connection_param->{'user'},
>> -pass => $connection_param->{'pass'},
>> );
>>
>> Thanks
>> Regards
>>
>>> To disconnect from the DB disconnect_all() is perfect. If you mean how
>>> do I disconnect& reclaim the memory that's a murkier subject ...
>>>
>>> On 9 Sep 2010, at 16:36, Sébastien Moretti wrote:
>>>
>>>> Hi
>>>>
>>>> What is the proper way to disconnect from ensembl databases with the
>>>> API ?
>>>>
>>>> I found disconnect_all(), clear().
>>>> Others ?
>>>>
>>>> Regards
>>
>
>
>
> --
> Sébastien Moretti
> SIB Vital-IT EMBnet, Quartier Sorge - Genopode
> CH-1015 Lausanne, Switzerland
> Tel.: +41 (21) 692 4079/4221
>
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev
--
Andrew Yates Ensembl Genomes Engineer
EMBL-EBI Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK http://www.ensemblgenomes.org/
More information about the Dev
mailing list