# HG changeset patch # User RĂ©mi Cardona # Date 1435046561 -7200 # Node ID 5b33ca2c61e04a7cc42c837da877a0caab9cce20 # Parent 8e04ab5582d9c79f206e7a1a57525296e4105e31 [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". diff -r 8e04ab5582d9 -r 5b33ca2c61e0 server/session.py --- 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)