Menu

#450 bad context for cached Value Workflow

open
nobody
None
9
2011-11-14
2011-11-14
No

Hi,

I think the use of the cache for PO objects in Adempiere is quite problematic, in the past I found a couple of bug related to this problem:

https://sourceforge.net/tracker/index.php?func=detail&aid=1939524&group_id=176962&atid=879332
https://sourceforge.net/tracker/index.php?func=detail&aid=2908208&group_id=176962&atid=879332

The move to ZK complicate this even further, that's what I found lately:

Value Workflows are retrieved with the method org.compiere.wf.MWorkflow.getDocValue(Properties, int, int, String) as soon as the first PO.Save() is called, that means for instance as soon as a new MSession is created. The method loads into the cache every Value Workflow the first time is called, subsequent call just return the cached object. The problem, once again, is with the context, if the clients/orgs are different, for instance because the first call was made by system or because you do have multiple clients/orgs then the behavior is quite erratic. For example in our test it was creating the workflow activity under system (ad_client_id=0) and not under the correct client. As a quick patch I completely disabled the use of the cache inside the method, but I'm sure we will find other similar situations.

Regards,
Angelo Dabalà

Discussion


Log in to post a comment.