[Twisted-Python] PATCH: runQuery

Dave Peticolas dave at krondo.com
Thu Mar 6 20:49:51 EST 2003

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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030306/f0ad7ba6/attachment.pgp 

More information about the Twisted-Python mailing list