Bugs item #2432880, was opened at 2008-12-16 10:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2432880&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: SQLObject release (specify)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Iwan Vosloo (iwanvosloo)
Assigned to: Nobody/Anonymous (nobody)
Summary: dropTable creates extra connection when used in transaction
Initial Comment:
This has been tested with sqlobject (versions 0.9.1 or 0.10.2) and postgresql.
If you start a transaction, and then call dropTable on a class, that call creates an extra postgresql connection, outside of the transaction.
This is caused by the following line in dbconnection.py:
755 attr = getattr(self._dbConnection, attr)
which is called while self is still the Transaction, for attr
'server_version'.
This, however, returns the server_version method on the connection, bound to the _dbconnection the getattr was called on. This bound method gets called, and inside it self.queryOne is called:
304 server_version = self.queryOne("SELECT version()")[0]
This call creates the second connection.
Attached is a file demonstrating the issue, and a temporary workaround.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2432880&group_id=74338
|