Re: [SQLObject] Re: Preparing for 0.6.1
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Carlos R. <car...@gm...> - 2004-12-31 18:25:53
|
On Fri, 31 Dec 2004 11:57:55 -0600, Luke Opperman <lu...@me...> wrote: > 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? I may be wrong, but some kinds of connection objects are thread-sefe. There's some info on the threadsafety value that is exposed by the DBAPI 2.0... I don't have enough experience to tell how does it behave in practice. -- Carlos Ribeiro Consultoria em Projetos blog: http://rascunhosrotos.blogspot.com blog: http://pythonnotes.blogspot.com mail: car...@gm... mail: car...@ya... |