Re: [SQLObject] Re: Preparing for 0.6.1
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2004-12-31 13:11:51
|
On Fri, Dec 31, 2004 at 11:05:41AM -0200, Carlos Ribeiro wrote: > > conn = connectionForURI("...") > > if connection.supportTransactions: > > conn = conn.transaction() > > > > class Person(SQLObject): > > _connection = conn > > Genuinely curious. What are the actual semantics of this? Do it opens > a transaction for the entire lifetime of the connection, or does it > use a transaction for each operation? The first is not useful, and the > later seems like overkill (not to mention that the granularity of the > transaction, in both cases, leaves a lot to be desired). Neither. You can call conn.begin(), conn.commit() and conn.rollback() at your will. After calling conn.rollback() you have to call conn.begin(). That's simple. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |