[ensembl-dev] Clean disconnection for db
Sébastien Moretti
sebastien.moretti at unil.ch
Fri Sep 10 10:07:32 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
Thank you
Regards
>>> 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
More information about the Dev
mailing list