Entity events loop

@EventListener
public void onJournalEntryChanged(EntityChangedEvent< JournalEntry > event) { … }

I get the modified object from this event and modify it and update it again via dataManager.save(). But it will return to this event and become a loop. Is there a way to make this happen only once?

Hi @asroryuldashev57 ,

I think, if you update the modified entity anyway, using the EntitySavingEvent would be a better choice, since you can directly update the modified entity and save both the modification and your additional update in one step. This also don’t create the recursion problem when updating an entity in the EntityChangedEvent.

https://docs.jmix.io/jmix/data-access/entity-events.html#saving-loading-events

Just my 2 ct.

Regards,
Stefan