[JBoss jBPM] - Re: Lost update problem?
by kukeltje
I know... the 'compare' has to go deeper... with 3 and 4 NOT storing it to the root level but e.g. using a special node which looks all data up, compares all three and maybe create new tasks (e.g. for the manager) BEFORE storing it at the root level. These kinds of 'decisions' have to be modelled into the process.
When you have threads instead of tasks it is more difficult, but not impossible... still most of the time it has to be in the process. Be it real workflow (e.g. assign to a manager to decide) or bpel like...(have some automatic rule to decide which 'wins')
Maybe the engine can help out a little by just giving a warning like 'original value has changed since reading'. This is already possible by using the logging from jBPM, since all updates are stored there. Sounds like some Business Process Isolation Level configuration ;-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162193#4162193
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162193
16 years, 8 months
[JBoss jBPM] - Re: Lost update problem?
by twiceknightly
I see what you mean kukeltje about keeping the changes local(related to the token) first, then adding the changes to the higher level. I'm not sure that would work though and this is my reasoning.
Eventhough the tokens have a different scope there is still only one context instance being shared between two threads. So
1. Thread one gets the context instance with variable A stored already at the root level.
2. Thread two gets the context instance with variable A stored already at the root level.
3. Thread one makes an update to his local var B and persists both his var B and var A.
4. Thread two makes an update to his local var C and persits both his var C and var A
Unfortunately the persistence of local var B by thread one (number 3) is lost when 4 is performed?
Is this not correct?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162186#4162186
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162186
16 years, 8 months
[JBoss jBPM] - Re: Lost update problem?
by kukeltje
Your observations are correct, this is the classical concurrency issue and it is not an easy issue to solve. What you can at least do is declare each variable as a local one. Then they will be stored purely related to the token *first*... in a second step you can update the variable on a higher level after checking differences and you can always find all data back. (you also could do this via the logging mechanism since each update is logged)
Hibernate locking will not solve this, maybe hibernate versioning can in some way (but you'd have to know the initial version somewhere).
Normally we store as many data as possible in our own domain model and use processvariables for kind of fixed data like the businesskey.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162115#4162115
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162115
16 years, 8 months