From: Daniel D. <dan...@ba...> - 2012-02-01 18:21:35
|
Oleg Broytman <ph...@ph...> writes: > Aha, got it. You've stumbled upon a subtle bug in SQLiteConnection. > SQLiteConnection uses a different (from its parent class DBAPI) > implementation of .getConnection() and maintain its own pool - > ._threadPool along with DBAPI._pool. But it doesn't clear the pool on > .close(). > > The quick-and-dirty solution for you is to clear the pool yourself: > > Rebuildd().sqlconnection.close() > Rebuildd().sqlconnection._threadPool = {} Thanks, this solve my issue. > You preserve an old SQLiteConnection, so you don't need the > following: > >> sqlobject.dbconnection.TheURIOpener.cachedURIs={} Ok, I plan to change rebuildd code and avoid singletons, this will permit to make each unit test in a separate context (and directory) to avoid side effects. At that time, I think I will be freed of all of this. [...] > And, BTW, this > >> os.unlink("/tmp/rebuildd-tests.db") > > is just > > Rebuildd().sqlconnection.dropDatabase() Thanks a lot. -- Daniel Dehennin Récupérer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1 |