Re: [SQLObject] bug: connection/transaction leak?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Guenther S. <gs...@sy...> - 2003-12-19 20:46:22
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 18 December 2003 00:50, you wrote: hi, > Hmm.. that shouldn't happen. Though looking at the code, I don't do a > whole lot to return connections. The transaction should get garbage > collected, and __del__ releases the connection, but I can imagine > there'd be lots of reasons a transaction wouldn't get collected (though > in this case it looks like it should be). > > Probably on commit()/rollback() the transaction should become invalid, > and the connection should be returned. Or maybe you could run > trans.begin() to revalidate it (at which point it'd grab another > connection). using the following while block: while 1: ___ b = Account.new(name = "FOO" + str(time.time()), password = "bar", connection = conn) ___ print sys.getrefcount(conn) ___ del(b) shows an increasing refcount of conn with every iteration. maybe the leak is somewhere in the sqlobject class? cu /gst -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/42OUZtF7I/+gjcERAqPsAKCuapSeoG3udyvRrytIRu67bqxRzACgzO5F FblDKu3mUSZvZ0RNtfO57Yo= =IX1s -----END PGP SIGNATURE----- |