Re: Closing connection

Daniel Dehennin <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <[email protected]>
Oleg Broytman <[email protected]> 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

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d

_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEAREKAAYFAk8pgqQACgkQb97L6l6P4FtxTQCeNAYbcsykyEHBlQqbLOP7Lano
9nEAn1Xr3YyHtHiPNPsvXI2vEf2K19i2
=bZAk
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.