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 13:05:49
|
On Fri, 31 Dec 2004 15:59:15 +0300, Oleg Broytmann <ph...@ma...> wrote: > On Fri, Dec 31, 2004 at 01:02:25AM -0500, Brian Beck wrote: > > - Do only methods that are passed the transaction provided by > > conn.transaction() take advantage of it? If so, how do you insert new > > rows within a transaction? I can only see one way to create a new row, > > i.e.: Person(name='Brian'), but no way to pass this a transaction > > 'instance' (I tried a few different ways). > > The simplest method is to create a connection, wrap it into a > transactiona and after that decalre your tables: > > 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). -- Carlos Ribeiro Consultoria em Projetos blog: http://rascunhosrotos.blogspot.com blog: http://pythonnotes.blogspot.com mail: car...@gm... mail: car...@ya... |