Re: [SQLObject] Re: Preparing for 0.6.1
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Luke O. <lu...@me...> - 2004-12-31 17:58:03
|
Quoting Oleg Broytmann <ph...@ph...>: > 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 >> > 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. Am I correct in thinking this is unusable in a multi-threaded environment, like Webware? The Person class shares one underlying connection to the database (pool is bypassed by Transaction), so if I have two interleaved requests to an UpdateUser process (whether for different user records or not) they will both try to begin(), and when one commits the other's changes up to that point go along, or a rollback in one ends the transaction for the other? Or am I missing something? - Luke |