[ISSUE] EntityChangedEvent not being published

entity-changed-event.7z (6.9 KB)

I attached a project which reproduces the following issue. EntityChangedEvent is not triggered before commit. As it should be.

Test entity has a single field, thread, that is populated automatically by the listener. The listener it’s not called before commit.

Listener does not work anymore. Period.
Neither the old ones, nor the ones introduced with cuba7.

What a mess… :expressionless:

It’s a problem with a bean validation in the DataManager and EntityChangedEvent. EntityChangedEvent works after bean validation. It is reproduced only on the 7.1 version.

As a workaround, try to disable bean validation using property:
cuba.dataManagerBeanValidation Appendix B: Application Properties - CUBA Platform. Developer’s Manual

We’ll try to rework operations order (EntityChangedEvent/bean validation) before release 7.1.

Thank you for reporting the problem and testing release 7.1.

Bean validation is set to false, not on the test project, but on my main project, where I encountered this issue.

EntityChangedEvent works after database flush, so database constraints work before this event. Use EntityPersistingEvent (EntityPersistingEvent - CUBA Platform. Developer’s Manual) instead of EntityChangedEvent