Commit 6ca06768 authored by Vincent Pelletier's avatar Vincent Pelletier

Same fixes as commits 19076 and 19077 on SQLQueue.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19087 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e009de61
...@@ -411,20 +411,6 @@ class SQLDict(RAMDict, SQLBase): ...@@ -411,20 +411,6 @@ class SQLDict(RAMDict, SQLBase):
method(*args) method(*args)
except: 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()) 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: try:
abortTransactionSynchronously() abortTransactionSynchronously()
except: except:
...@@ -432,6 +418,13 @@ class SQLDict(RAMDict, SQLBase): ...@@ -432,6 +418,13 @@ class SQLDict(RAMDict, SQLBase):
LOG('SQLDict', PANIC, LOG('SQLDict', PANIC,
'abort failed, thus some objects may be modified accidentally') 'abort failed, thus some objects may be modified accidentally')
return True # Stop processing messages for this tic call for this queue. 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. # Abort if something failed.
if len([x for x in message_uid_priority_list if not x[1].is_executed]) != 0: if len([x for x in message_uid_priority_list if not x[1].is_executed]) != 0:
endTransaction = abortTransactionSynchronously endTransaction = abortTransactionSynchronously
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment