On 18-10-2008, Christoph Zwerschke wrote:
> William Dode schrieb:
>> Then i have to set closeable when i create it ?
>> What i would like is to have closeable set to False, and decide *after*
>> (for maintenance of the db) that i want a brut close.
>
> You can set closeable to True when creating the PersistentDB instance,
> then all connections will be closeable. But you usually don't want that.
> Instead, the idea is to silently ignore the close and next time a
> connection in that thread is requested, reuse that same connection.
> When you close your application and all threads are shut down, then the
> connections will be closed automatically. Closing them earlier will not
> help, since PersistentDB will try to reopen them anyway when a thread
> requests a new connection. If the database is shut down, then your
> threads get connection errors, and when it is up again, new connections
> will be opened again.
You're right, i will handle this at the application level. I mean, it's
safer to stop the application if i need some maintenance on the
database.
--
William Dodé - http://flibuste.net
Informaticien Indépendant
|