[SQL-CVS] r1578 - SQLObject/trunk/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2006-02-06 19:40:30
|
Author: phd Date: 2006-02-06 12:40:21 -0700 (Mon, 06 Feb 2006) New Revision: 1578 Modified: SQLObject/trunk/sqlobject/dbconnection.py Log: Set and reset autocommit on the low-level connection. Modified: SQLObject/trunk/sqlobject/dbconnection.py =================================================================== --- SQLObject/trunk/sqlobject/dbconnection.py 2006-02-06 18:56:55 UTC (rev 1577) +++ SQLObject/trunk/sqlobject/dbconnection.py 2006-02-06 19:40:21 UTC (rev 1578) @@ -866,6 +866,8 @@ def _makeObsolete(self): self._obsolete = True + if self._dbConnection.autoCommit: + self._dbConnection._setAutoCommit(self._connection, 1) self._dbConnection.releaseConnection(self._connection, explicit=True) self._connection = None @@ -876,6 +878,7 @@ assert self._obsolete, "You cannot begin a new transaction session without rolling back this one" self._obsolete = False self._connection = self._dbConnection.getConnection() + self._dbConnection._setAutoCommit(self._connection, 0) def __del__(self): if self._obsolete: |