cancel
Showing results for 
Search instead for 
Did you mean: 

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

leac87
Champ in-the-making
Champ in-the-making
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!
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Currently, we don't support combining updates into one update statement, so you'll see multiple updates to the same entity. But I agree it would be a nice feature to have.

Best regards,

leac87
Champ in-the-making
Champ in-the-making
Ah ok I see, thank you for your response!