[Twisted-Python] PATCH: runQuery

Federico Di Gregorio fog at initd.org
Thu Mar 6 18:12:29 EST 2003


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.)

-- 
Federico Di Gregorio
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
  Gli avvoltoi cinesi si nutrono di arte, ma possono anche mangiare
   i `domani'.                                        -- Haruki Murakami
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030307/23ac6dc2/attachment.pgp 


More information about the Twisted-Python mailing list