AnsweredAssumed Answered

Performance on JPA with BPMN. (How updates are executed  on a JPA Entity during a flow)

Question asked by leac87 on Dec 4, 2014
Latest reply on Dec 5, 2014 by leac87
Performance on JPA with BPMN. (How updates are executed  on a JPA Entity during a flow)

Hi everyone,

I don't fully understand how updates are generated when Activiti manages a JPA Entity. I have this feature working, but I would like to know if there is a performance improvement to apply on this point by changing some configuration.

The scenario is as follows: Let's say I have a flow called remodelHouse.bpmn and a 'House' Entity, which I pass to Activiti  when I execute the method startProcessInstanceByKey(). In this flow, I have a task which changes the House attribute 'numberOfRooms' and another different task which changes the House attribute 'wallsColor'.

Activiti manages the flow as a transaction, but when I inspect the updates issued by Activiti, I see 2 different updates, as follows:


update House set numberOfRooms = 'newNumberOfRoom' where…
update House set wallsColor = 'newColor' where…


And what I would like to be issued is:


update House set numberOfRooms = 'newNumberOfRoom', wallsColor = 'newColor'  where…


is possible to tell Activity to apply all changes on an Entity all together at the end of the flow, in order to avoid the extra statements?

Thanks in advance!

Outcomes