[Erp5-report] r18467 - in /erp5/trunk/products/CMFActivity: Activity/ skins/activity/
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Dec 21 11:45:35 CET 2007
Author: vincent
Date: Fri Dec 21 11:45:34 2007
New Revision: 18467
URL: http://svn.erp5.org?rev=18467&view=rev
Log:
Call rollback before commiting when in an error path.
Added:
erp5/trunk/products/CMFActivity/skins/activity/SQLDict_rollback.xml
erp5/trunk/products/CMFActivity/skins/activity/SQLQueue_rollback.xml
Modified:
erp5/trunk/products/CMFActivity/Activity/SQLDict.py
erp5/trunk/products/CMFActivity/Activity/SQLQueue.py
Modified: erp5/trunk/products/CMFActivity/Activity/SQLDict.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/Activity/SQLDict.py?rev=18467&r1=18466&r2=18467&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/Activity/SQLDict.py (original)
+++ erp5/trunk/products/CMFActivity/Activity/SQLDict.py Fri Dec 21 11:45:34 2007
@@ -390,6 +390,13 @@
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.
+ self.SQLDict_rollback()
makeMessageListAvailable(to_free_uid_list)
except:
LOG('SQLDict', PANIC, 'Failed to free messages: %r' % (to_free_uid_list, ), error=sys.exc_info())
Modified: erp5/trunk/products/CMFActivity/Activity/SQLQueue.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/Activity/SQLQueue.py?rev=18467&r1=18466&r2=18467&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/Activity/SQLQueue.py (original)
+++ erp5/trunk/products/CMFActivity/Activity/SQLQueue.py Fri Dec 21 11:45:34 2007
@@ -274,6 +274,13 @@
value[1].is_executed = 0
LOG('SQLQueue', WARNING, 'Exception raised when invoking message (uid, path, method_id) %r' % (value, ), error=sys.exc_info())
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.
+ self.SQLQueue_rollback()
makeMessageListAvailable([value[0]])
except:
LOG('SQQueue', PANIC, 'Failed to free message: %r' % (value, ), error=sys.exc_info())
Added: erp5/trunk/products/CMFActivity/skins/activity/SQLDict_rollback.xml
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/skins/activity/SQLDict_rollback.xml?rev=18467&view=auto
==============================================================================
--- erp5/trunk/products/CMFActivity/skins/activity/SQLDict_rollback.xml (added)
+++ erp5/trunk/products/CMFActivity/skins/activity/SQLDict_rollback.xml Fri Dec 21 11:45:34 2007
@@ -1,0 +1,11 @@
+<dtml-comment>
+title:
+connection_id:cmf_activity_sql_connection
+max_rows:1000
+max_cache:0
+cache_time:0
+class_name:
+class_file:
+</dtml-comment>
+<params></params>
+ROLLBACK
Added: erp5/trunk/products/CMFActivity/skins/activity/SQLQueue_rollback.xml
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/skins/activity/SQLQueue_rollback.xml?rev=18467&view=auto
==============================================================================
--- erp5/trunk/products/CMFActivity/skins/activity/SQLQueue_rollback.xml (added)
+++ erp5/trunk/products/CMFActivity/skins/activity/SQLQueue_rollback.xml Fri Dec 21 11:45:34 2007
@@ -1,0 +1,11 @@
+<dtml-comment>
+title:
+connection_id:cmf_activity_sql_connection
+max_rows:1000
+max_cache:0
+cache_time:0
+class_name:
+class_file:
+</dtml-comment>
+<params></params>
+ROLLBACK
More information about the Erp5-report
mailing list