[Twisted-Python] PATCH: runQuery

Federico Di Gregorio fog at initd.org
Fri Mar 7 01:33:58 MST 2003


Il ven, 2003-03-07 alle 02:49, Dave Peticolas ha scritto:
> On Thu, 2003-03-06 at 15:12, Federico Di Gregorio wrote:
> > Il gio, 2003-03-06 alle 21:53, Dave Peticolas ha scritto:
> > 
> > > Good catch! I wonder, though, shouldn't we be calling
> > > commit() instead of rollback()? What if the query had
> > > side-effects in the database, won't it undo those
> > > changes?
> > 
> > this is exactly why rollback is used. a select is supposed to *not* have
> > side-effects and having your app depend on some side-effect commited by
> > a method call supposed to just read from the database is quite wrong.
> > (note that selects on stuff like nextval() on sequences are transaction
> > transparent and so not influenced by rollback and commit.)
> 
> I disagree. A select generally doesn't have side-effects,
> but it is possible to write a select call which does. One
> example is a rule which logs queries. Why should we
> arbitrarily rollback select calls just because *we*
> think it's wrong to use selects with side-effects?
> 
> I think you are imposing policy for no reason.

you're right. btw, to put it simple, i think the whole concept of
runQuery/runOperation is b0rken. 

i'll resend a patch with s/rollback/commit/.

-- 
Federico Di Gregorio
Debian GNU/Linux Developer & Italian Press Contact        fog at debian.org
INIT.D Developer                                           fog at initd.org
  99.99999999999999999999% still isn't 100% but sometimes suffice. -- Me
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20030307/6008364c/attachment.sig>


More information about the Twisted-Python mailing list