fix auto-rollback on unauthorized error:
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 10 Feb 2010 08:07:53 +0100
changeset 4532 85116e75f561
parent 4531 530a5997d51b
child 4533 05eadf88b797
fix auto-rollback on unauthorized error: * don't rollback if a commit is processing * don't free pool on rollback
server/querier.py
--- a/server/querier.py	Wed Feb 10 08:06:02 2010 +0100
+++ b/server/querier.py	Wed Feb 10 08:07:53 2010 +0100
@@ -666,7 +666,14 @@
             # the session). Even though, this is done here for a better
             # consistency: getting an Unauthorized exception means the
             # transaction has been rollbacked
-            session.rollback()
+            #
+            # notes:
+            # * we should not reset the pool here, since we don't want the
+            #   session to loose its pool during processing
+            # * don't rollback if we're in the commit process, will be handled
+            #   by the session
+            if session.commit_state is None:
+                session.rollback(reset_pool=False)
             raise
         # build a description for the results if necessary
         descr = ()