Re: pydo docs suggestion

Jacob Smullyan <[email protected]> Tue, 21 Jun 2005 23:03:38 -0400
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
Hope you don't mind, I'm ccing the list for this.

On Wed, Jun 22, 2005 at 02:45:37PM +1200, Kieran Holland wrote:
> I wonder if it would be useful to have some global setting allowing
> automatic commits?  I suspect that in many simple use cases
> transactions are excess to requirements, only cluttering what is
> otherwise a very clean interface.  Just an idea.

I personally would never use such a feature, but in fact it already
exists, as the dbi's autocommit property is setable:

   db=getConnection('myalias')
   db.autocommit=True
   # go to town

The autocommit property may not always be adjustable; that depends on
the underlying driver, and the property may also be buggy with some
drivers, because I haven't tested using it this way yet.  Holler if
you see problems.

I sympathize with your aesthetic instinct, but painful experience has
alas made me profoundly -1 towards the notion that transactions are
clutter in any context.  I type "begin;" in psql if I'm going to
perform the most trivial mutation.  I don't trust myself to do
otherwise, and unfortunately I'm sure I'm right not to.  The burned
hand teaches best.

j

-- 
Jacob Smullyan
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCuNUKuqamFyFXXLIRAqfvAKC+BySllMoigBf4yYtkdQDMCqo0SACghkYl
2pbnRY1zOQ0pWJNuSeOUI5I=
=bH8i
-----END PGP SIGNATURE-----