From d743cfbef5d88f3db43eb1d495ac7ef7e8fb18dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 13 Mar 2007 14:25:18 +0000
Subject: [PATCH] if a error happen in ActivityTool.invoke or around, the
 message will immediatly be put in INVOKE_ERROR_STATE, but we will LOG a
 traceback (maybe we should also call notifyUser). remove the obsolete comment
 "what happens if read conflict error restarts transaction", because this is
 handled explicitly here.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13404 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFActivity/Activity/SQLDict.py  | 2 ++
 product/CMFActivity/Activity/SQLQueue.py | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/product/CMFActivity/Activity/SQLDict.py b/product/CMFActivity/Activity/SQLDict.py
index 9484597af4..3eb066c61e 100644
--- a/product/CMFActivity/Activity/SQLDict.py
+++ b/product/CMFActivity/Activity/SQLDict.py
@@ -326,6 +326,8 @@ class SQLDict(RAMDict):
             if len(uid_list):
               activity_tool.SQLDict_assignMessage(uid = uid_list, 
                                                   processing_node = INVOKE_ERROR_STATE)
+              LOG('SQLDict', WARNING, 'Error in ActivityTool.invoke', e=sys.exc_info())
+
         get_transaction().commit()
         return 0
 
diff --git a/product/CMFActivity/Activity/SQLQueue.py b/product/CMFActivity/Activity/SQLQueue.py
index bd934e8fb6..d81ec94506 100644
--- a/product/CMFActivity/Activity/SQLQueue.py
+++ b/product/CMFActivity/Activity/SQLQueue.py
@@ -122,7 +122,7 @@ class SQLQueue(RAMQueue):
           return 0
 
         # Try to invoke
-        activity_tool.invoke(m) # Try to invoke the message - what happens if read conflict error restarts transaction ?
+        activity_tool.invoke(m) # Try to invoke the message
         if m.is_executed:                                          # Make sure message could be invoked
           get_transaction().commit()                                        # If successful, commit
       except:
@@ -142,6 +142,8 @@ class SQLQueue(RAMQueue):
           # For the other exceptions, put it into an error state.
           activity_tool.SQLQueue_assignMessage(uid = line.uid, 
                                                processing_node = INVOKE_ERROR_STATE)
+          LOG('SQLQueue', WARNING, 'Error in ActivityTool.invoke', e=sys.exc_info())
+
         get_transaction().commit()
         return 0
 
-- 
2.30.9