[server/session] Roll back in connection exit
This was changed in commit 8b35a898b334 "[server] remove cnxset
tracking, it is now unneeded".
When exiting a CubicWeb Connection, the database connection is put back
into the common pool. At that point anything done during the lifetime
of the CubicWeb Connection needs to be committed or rolled back.
Do a proper rollback to finish the transaction, as was happening before
the above-mentionned commit.
This showed up on testing with postgresql, when a DB schema modification
was blocked by an old connection that was still "in transaction".
--- a/server/session.py Wed May 20 16:13:07 2015 +0200
+++ b/server/session.py Tue Jun 23 10:02:41 2015 +0200
@@ -392,7 +392,7 @@
def __exit__(self, exctype=None, excvalue=None, tb=None):
assert self._open # actually already open
- self.clear()
+ self.rollback()
self._open = False
self.cnxset.cnxset_freed()
self.repo._free_cnxset(self.cnxset)