Re: [SQLObject] More transaction troubles
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2003-09-06 18:07:42
|
On Saturday, September 6, 2003, at 03:58 AM, Randall Randall wrote: > Okay, so I got the current CVS, but transactions > still seem to not work. :) > > >>> r = Person.new(firstName='my', lastName='lastname', > connection=trans) > >>> r.firstName = 'Bob' > >>> trans.commit() > >>> r.firstName = 'Billy' > >>> trans.rollback() > >>> print r.firstName > Billy Hmmm... that's odd. Maybe you should give debug=1 to your original connection and see what SQL is being sent. > I thought that perhaps I needed to pull an object from > the db in order to use transactions with it, so > > >>> del r > >>> q = Person(1, trans) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/usr/lib/python2.2/site-packages/SQLObject/SQLObject.py", line > 407, in __new__ > val._init(id, connection, selectResults) > File "/usr/lib/python2.2/site-packages/SQLObject/SQLObject.py", line > 665, in _init > selectResults = (connection or > self._connection)._SO_selectOne(self, dbNames) > AttributeError: 'Transaction' object has no attribute '_SO_selectOne' Well, that's just a bug. I'll look into it, I think I have a fix. Of course it will go into CVS and you won't be able to check it for a day. Which brings up the problem of anonymous CVS access on SF. I'll have to write a script to make HEAD available in a more timely manner. Ian |