Author: phd
Date: 2009-04-17 11:09:12 -0600 (Fri, 17 Apr 2009)
New Revision: 3856
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/dbconnection.py
Log:
Transaction instances now explicitly raises TypeError on close().
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2009-04-17 16:44:30 UTC (rev 3855)
+++ SQLObject/branches/0.9/docs/News.txt 2009-04-17 17:09:12 UTC (rev 3856)
@@ -35,6 +35,10 @@
Transaction.__getattr__() cannot properly wrap 'self' so a property is
called with wrong 'self'.
+* Transaction instances now explicitly raises TypeError on close() -
+ without this calling Transaction.close() calls connection.close() which
+ is wrong.
+
SQLObject 0.9.9
===============
Modified: SQLObject/branches/0.9/sqlobject/dbconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/dbconnection.py 2009-04-17 16:44:30 UTC (rev 3855)
+++ SQLObject/branches/0.9/sqlobject/dbconnection.py 2009-04-17 17:09:12 UTC (rev 3856)
@@ -950,6 +950,9 @@
return
self.rollback()
+ def close(self):
+ raise TypeError('You cannot just close transaction - you should either call rollback(), commit() or commit(close=True) to close the underlying connection.')
+
class ConnectionHub(object):
"""
|