[SQLObject] bug: connection/transaction leak?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Guenther S. <gs...@sy...> - 2003-12-17 21:24:19
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hi, i noticed that when using sqlobject together with zope after some time more and more connections are open to my postgresql server. first i thought that it was a zope bug (i am binding sqlobject transactions= to zope transactions and assumed, that the transaction objects were referenced from somewhere in the ZODB), but now it seems that it is a bug in sqlobject. =20 =2D -------- 8< -------- 8< -------- 8< -------- 8< -------- 8< -------- from SQLObject import * import time class Account(SQLObject): ___ name =3D StringCol(alternateID =3D True) ___ password =3D StringCol() = =20 conn =3D PostgresConnection('user=3Dzope dbname=3DWebspaceNG', autoCommit = =3D False) = =20 while 1: ___ trans =3D conn.transaction() ___ b =3D Account.new(name =3D "FOO" + str(time.time()), password =3D "bar"= , connection =3D trans) ___ trans.commit() ___ raw_input() =2D -------- 8< -------- 8< -------- 8< -------- 8< -------- 8< -------- if you run this code, with every iteration an additional connection gets opened to the postgresql server (until the max. connection limit is reached= & postgresql refuses new connections). cu /gst =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/4Ml1ZtF7I/+gjcERAkT8AJ0bvPL8+SoglxVTWbVrAdPmO/qRUACZAc9y lAIFFBN8XaQRxA0btc4E8iM=3D =3DXoeD =2D----END PGP SIGNATURE----- |