diff --git a/product/CMFActivity/Activity/SQLDict.py b/product/CMFActivity/Activity/SQLDict.py index 8887711fad069cb86e047a9e9ae32d50a59d06eb..e58a81385ea521ddaeb28b9d87a03e35d736b33b 100644 --- a/product/CMFActivity/Activity/SQLDict.py +++ b/product/CMFActivity/Activity/SQLDict.py @@ -411,20 +411,6 @@ class SQLDict(RAMDict, SQLBase): method(*args) except: LOG('SQLDict', WARNING, 'Exception raised when invoking messages (uid, path, method_id) %r' % ([(x[0], x[1].object_path, x[1].method_id) for x in message_uid_priority_list], ), error=sys.exc_info()) - to_free_uid_list = [x[0] for x in message_uid_priority_list] - try: - # Rollback all changes made on activity connection. - # We will commit to make messages available, and we cannot control - # what was done by the activity: it might have used the activity - # connection. As the transaction failed, we must rollback these - # potential changes before being allowed to commit in - # makeMessageListAvailable. - activity_tool.SQLDict_rollback() - makeMessageListAvailable(to_free_uid_list) - except: - LOG('SQLDict', PANIC, 'Failed to free messages: %r' % (to_free_uid_list, ), error=sys.exc_info()) - else: - LOG('SQLDict', TRACE, 'Freed messages %r' % (to_free_uid_list)) try: abortTransactionSynchronously() except: @@ -432,6 +418,13 @@ class SQLDict(RAMDict, SQLBase): LOG('SQLDict', PANIC, 'abort failed, thus some objects may be modified accidentally') return True # Stop processing messages for this tic call for this queue. + to_free_uid_list = [x[0] for x in message_uid_priority_list] + try: + makeMessageListAvailable(to_free_uid_list) + except: + LOG('SQLDict', PANIC, 'Failed to free messages: %r' % (to_free_uid_list, ), error=sys.exc_info()) + else: + LOG('SQLDict', TRACE, 'Freed messages %r' % (to_free_uid_list)) # Abort if something failed. if len([x for x in message_uid_priority_list if not x[1].is_executed]) != 0: endTransaction = abortTransactionSynchronously