Vincent Pelletier
2010-04-12 13:45:26 UTC
Hi.
This mail is about the following wiki page change:
http://www.erp5.org/HowToUseTheCmfActivityTool?action=diff&rev1=39&rev2=40
This change is not as precise as it should be, and as I don't want to just
edit it without explanations, I prefer to send a mail here.
First, I'll start stating the obvious:
CMFActivity provides as way to make executions asynchronous in Zope, in a
transactional manner.
Now, a bit less obvious:
Doing so, it provides 2 main "policies" for such executions:
- factorised executions (SQLDict)
Used with "activate(activity='SQLDict')" or "activate()"
- systematic executions (SQLQueue)
Used with "activate(activity='SQLQueue')"
By "factorised", I mean that when independent transactions trigger activities,
maybe some of those activities have no need to be executed more than once.
A trivial example is when doing 2 consecutive changes on a document, each
change will plan an indexation of modified document. Executing the indexation
operation once is enough to have the latest version in the catalog.
And now, to the point ("points", as they are 2):
- If one wants that each and every activity must be executed, he should use
SQLQueue by specifying it. So the proposed page change advertises a way to
make SQLDict somewhat work like SQLQueue. This is what I don't like in
mentioned change.
- Finally, there is indeed a behaviour in SQLQueue which is surprising when it
first bites you, which is that the decision that 2 activities in SQLDict are
actually to be executed just once is based on a finite (and quite restricted
at that) list of activity properties. Aggravating, SQLDict is the default
behaviour when creating an activity, which makes this behaviour more
dangerous when not known beforehand (but I think backward compatibility will
strongly prevent us from changing this). I believe this should be mentioned
in the wiki page, with the list of activity properties it uses (which gets
extended from time to time).
This mail is about the following wiki page change:
http://www.erp5.org/HowToUseTheCmfActivityTool?action=diff&rev1=39&rev2=40
This change is not as precise as it should be, and as I don't want to just
edit it without explanations, I prefer to send a mail here.
First, I'll start stating the obvious:
CMFActivity provides as way to make executions asynchronous in Zope, in a
transactional manner.
Now, a bit less obvious:
Doing so, it provides 2 main "policies" for such executions:
- factorised executions (SQLDict)
Used with "activate(activity='SQLDict')" or "activate()"
- systematic executions (SQLQueue)
Used with "activate(activity='SQLQueue')"
By "factorised", I mean that when independent transactions trigger activities,
maybe some of those activities have no need to be executed more than once.
A trivial example is when doing 2 consecutive changes on a document, each
change will plan an indexation of modified document. Executing the indexation
operation once is enough to have the latest version in the catalog.
And now, to the point ("points", as they are 2):
- If one wants that each and every activity must be executed, he should use
SQLQueue by specifying it. So the proposed page change advertises a way to
make SQLDict somewhat work like SQLQueue. This is what I don't like in
mentioned change.
- Finally, there is indeed a behaviour in SQLQueue which is surprising when it
first bites you, which is that the decision that 2 activities in SQLDict are
actually to be executed just once is based on a finite (and quite restricted
at that) list of activity properties. Aggravating, SQLDict is the default
behaviour when creating an activity, which makes this behaviour more
dangerous when not known beforehand (but I think backward compatibility will
strongly prevent us from changing this). I believe this should be mentioned
in the wiki page, with the list of activity properties it uses (which gets
extended from time to time).
--
Vincent Pelletier
Vincent Pelletier