[SQL-CVS] r1580 - home/phd/SQLObject/paramstyles/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2006-02-06 19:41:42
|
Author: phd
Date: 2006-02-06 12:41:36 -0700 (Mon, 06 Feb 2006)
New Revision: 1580
Modified:
home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py
Log:
Merged patches from the revisions 1577:1578 from the trunk: set and reset autocommit on the low-level connection.
Modified: home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py 2006-02-06 19:41:00 UTC (rev 1579)
+++ home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py 2006-02-06 19:41:36 UTC (rev 1580)
@@ -879,6 +879,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
@@ -889,6 +891,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:
|