[Erp5-report] r18507 - /erp5/trunk/products/CMFActivity/Activity/SQLDict.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Dec 24 23:14:30 CET 2007
Author: vincent
Date: Mon Dec 24 23:14:30 2007
New Revision: 18507
URL: http://svn.erp5.org?rev=18507&view=rev
Log:
Move transaction commit inside "try" block.
Fix SQLQueue_rollback acquisition context.
Modified:
erp5/trunk/products/CMFActivity/Activity/SQLDict.py
Modified: erp5/trunk/products/CMFActivity/Activity/SQLDict.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/Activity/SQLDict.py?rev=18507&r1=18506&r2=18507&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/Activity/SQLDict.py (original)
+++ erp5/trunk/products/CMFActivity/Activity/SQLDict.py Mon Dec 24 23:14:30 2007
@@ -375,16 +375,16 @@
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 @@
# 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())
More information about the Erp5-report
mailing list