def commit(self):
- self.manager.get().commit()
-
- # We always remove the existing transaction & connection, for
- # simplicity. SQLObject does connection pooling, and we don't have any
- # indication that reconnecting every transaction would be a performance
- # problem anyway.
- self.desc._deactivate()
+ try:
+ self.manager.get().commit()
+ finally:
+ # We always remove the existing transaction & connection, for
+ # simplicity. SQLObject does connection pooling, and we don't have any
+ # indication that reconnecting every transaction would be a performance
+ # problem anyway.
+ self.desc._deactivate()
I think this patch will fix the bug in the ZopelessTransac tionManager:
=== modified file 'lib/canonical/ database/ sqlbase. py' database/ sqlbase. py 2007-02-03 19:10:03 +0000 database/ sqlbase. py 2007-02-19 04:18:51 +0000
self. set_isolation_ level(self. desc.isolation)
--- lib/canonical/
+++ lib/canonical/
@@ -336,13 +336,14 @@
def commit(self): get().commit( ) _deactivate( ) get().commit( ) _deactivate( )
- self.manager.
-
- # We always remove the existing transaction & connection, for
- # simplicity. SQLObject does connection pooling, and we don't have any
- # indication that reconnecting every transaction would be a performance
- # problem anyway.
- self.desc.
+ try:
+ self.manager.
+ finally:
+ # We always remove the existing transaction & connection, for
+ # simplicity. SQLObject does connection pooling, and we don't have any
+ # indication that reconnecting every transaction would be a performance
+ # problem anyway.
+ self.desc.
if self.implicitBegin:
self. begin()