diff --git a/product/CMFActivity/Activity/SQLDict.py b/product/CMFActivity/Activity/SQLDict.py index 551f98fe624648e6bbbab6a68ba70abe838848b9..c271f257164ef2cd141f499895134dfcf63ad234 100644 --- a/product/CMFActivity/Activity/SQLDict.py +++ b/product/CMFActivity/Activity/SQLDict.py @@ -375,16 +375,16 @@ class SQLDict(RAMDict, SQLBase): else: method = activity_tool.invoke args = (message_list[0], ) + # Commit right before executing messages. + # As MySQL transaction do no start exactly at the same time as ZODB + # transactions but a bit later, messages available might be called + # on objects which are not available - or available in an old + # version - to ZODB connector. + # So all connectors must be commited now that we have selected + # everything needed from MySQL to get a fresh view of ZODB objects. + get_transaction().commit() + # Try to invoke try: - # Commit right before executing messages. - # As MySQL transaction do no start exactly at the same time as ZODB - # transactions but a bit later, messages available might be called - # on objects which are not available - or available in an old - # version - to ZODB connector. - # So all connectors must be commited now that we have selected - # everything needed from MySQL to get a fresh view of ZODB objects. - get_transaction().commit() - # Try to invoke 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()) @@ -396,7 +396,7 @@ class SQLDict(RAMDict, SQLBase): # connection. As the transaction failed, we must rollback these # potential changes before being allowed to commit in # makeMessageListAvailable. - self.SQLDict_rollback() + 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())