Because of the inability to do complex queries using SQLObject, I've had to fall back to issuing direct SQL queries using the _connection attribute of the model classes. However, this seems to be causing some difficulty with transactions.

I've been getting the following exception:

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/ dbconnection.py", line 728, in assertActive assert not self._obsolete, "This transaction has already gone through ROLLBACK; begin another transaction" AssertionError: This transaction has already gone through ROLLBACK; begin another transaction

I'm fairly certain this has something to do with this code:

all= self._connection.queryAll('''[...really complex SQL query...]''')
return [Product.get(row[0]) for row in all[:limit]]

In this particular case, self is an instance of a model object. However, in other cases, I use the class connection as follows:

all= cls._connection.queryAll('''[...very complex query...]''')
return [cls.get(row[0]) for row in all[:limit]]

All seems to work OK for the first couple queries and then SQLObject explodes.

Certainly someone else must have encountered this. I can't be the only person using complex queries. How can I get around this problem?

Jeff

--
Jeff Watkins
http://newburyportion.com/

'I know about people who talk about suffering for the common good. It's never bloody them! When you hear a man shouting "Forward, brave comrades!" you'll see he's the one behind the bloody big rock and the one wearing the only really arrow-proof helmet!' -- Rincewind gives a speech on politics. (Terry Pratchett, Interesting Times)


Reply via email to