What database is this failing on? I am only setup to test sqlite and postgres
right now, and I just tried postgres again now and it still passes.
Actually, based on this bug I don't see how rollback(), begin() ever worked
reliably, since the new connection from begin _might_ end up with a
Also, if postgres, what module? We've had strange problems with psycopg 1.1.18
where sometimes calling conn.rollback() or conn.commit() seem to do nothing,
but haven't looked into whether it's a real bug. The manual test for it though
is to see if replacing those calls in Transaction with
self._connection.cursor().execute('rollback;') etc fixes things. (I'm using
1.1.20 currently, without any monkeying like that, where the tests are
Quoting Oleg Broytmann <phd@...>:
> On Wed, Dec 07, 2005 at 12:10:49PM -0600, Luke Opperman wrote:
>> I've attached a new test.
>> Here's the patch, which makes the tests pass for me on postgres:
>> Index: sqlobject/dbconnection.py
>> --- sqlobject/dbconnection.py (revision 1365)
>> +++ sqlobject/dbconnection.py (working copy)
>> @@ -857,6 +857,8 @@
>> def _makeObsolete(self):
>> self._obsolete = True
>> + if self._dbConnection.autoCommit:
>> + self._dbConnection._setAutoCommit(self._connection, 1)
>> self._connection = None
>> @@ -867,6 +869,7 @@
>> assert self._obsolete, "You cannot begin a new transaction session
>> without rolling back this one"
>> self._obsolete = False
>> self._connection = self._dbConnection.getConnection()
>> + self._dbConnection._setAutoCommit(self._connection, 0)
> The patch makes test_transactions.py fail:
> def test_transaction():
> if not supports('transactions'):
> trans = TestSOTrans._connection.transaction()
> TestSOTrans._connection.autoCommit = 'exception'
> TestSOTrans(name='joe', connection=trans)
> assert ([n.name for n in TestSOTrans.select(connection=trans)]
> E == ['bob', 'tim'])
>> assert ['bob', 'joe', 'tim'] == ['bob', 'tim']
> It seems 'joe' was not rolled back.
> Oleg Broytmann http://phd.pp.ru/ phd@...
> Programmers don't die, they just GOSUB without RETURN.
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> sqlobject-discuss mailing list
The Pursuit of Counterfactual Histories