[kforge-dev] persisted connections to the db

Rufus Pollock rufus.pollock at okfn.org
Sun Apr 9 11:19:51 UTC 2006

While trying to write test code for the new Database class 
(kforge.utils.db.Database) I just got bitten by the fact that the KForge 
application, once created, persists a connection to the database 
throughout the lifetime of the enclosing python session (persisted even 
if the given classes/functions using the db go out of scope -- this is 
because i think it is created at module level).

This means, for example, that once I've done something with the 
application (kforge.getA() or kforge.soleInstance) I can't delete the db 
as I get a 'db is being accessed by other users' error.

This isn't that big a deal since the occassions on which you wish to 
delete the db are fairly rare (and special) but I thought I should bring 
it up and ask whether it is behaviour we really want to have.



More information about the kforge-dev mailing list