Re: [SQLObject] MySQL and transactions
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Sidnei da S. <si...@re...> - 2003-07-23 17:52:11
|
On Thu, Jul 17, 2003 at 09:47:29PM -0500, Ian Bicking wrote: | On Thu, 2003-07-17 at 21:29, John A. Barbuto wrote: | > Hi, | > | > I noticed something strange when looking at the MySQL query log: after | > every query by SQLObject, a COMMIT was being issued. I tracked it down | > to the _runWithConnection method in the DBAPI class, which calls | > conn.commit() in line 3. I'm baffled as to why this is necessary. I'm | > not sure about Postgres, but in MySQL a COMMIT is ignored unless you're | > using InnoDB and AUTOCOMMIT=0. Any clues? | | Huh... I feel like I must have had some reason for that, but I don't | know what that might be. Speaking of the said line, I just got hit by it when trying to integrate SQLObject and Zope3. The problem was on a unittest, so not that big, but I would like to see an option to make this commit optional. Im not good at naming, but I would suggest something like `commit_before_execute` or something like that. It would be passed on the connection initialization and checked on the _runWithConnection method. Thoughts? []'s -- Sidnei da Silva (dreamcatcher) <si...@re...> Debian GNU/Linux 2.4.20-powerpc ppc "The Computer made me do it." |