[SQL-CVS] r1579 - SQLObject/branches/0.7-bugfix/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2006-02-06 19:41:08
|
Author: phd
Date: 2006-02-06 12:41:00 -0700 (Mon, 06 Feb 2006)
New Revision: 1579
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/dbconnection.py
Log:
Set and reset autocommit on the low-level connection.
Modified: SQLObject/branches/0.7-bugfix/sqlobject/dbconnection.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/dbconnection.py 2006-02-06 19:40:21 UTC (rev 1578)
+++ SQLObject/branches/0.7-bugfix/sqlobject/dbconnection.py 2006-02-06 19:41:00 UTC (rev 1579)
@@ -812,6 +812,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
@@ -822,6 +824,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:
|