TransactionListener and EntityChangeListener

Hi,

I’ve read in the documentation that:

BeforeCommitTransactionListener

beforeCommit() method is called before transaction commit after all entity listeners if the transaction is not read-only.

But in the this test project, TransactionListener is called before entityChangeListener when entity is edited. Why ?

Best regards, Stef.
CUBA 7.2.11
Test project: cuba-entity-persist-test.zip (109.6 KB)

Hi,

39 views, no response. Please tells me if the response is too obvious or not understandable ? It seems to me that it does not comply with the documentation. Am I wrong ?

Best regards, Stef.

Hi,
We will check your test project soon and let you know.
Thank you for your patience.

1 Like

Hi,
The documentation specifies order only for Entity Listeners - CUBA Platform. Developer’s Manual.

Entity listeners and EntityChangedEvent are different mechanisms for entity change processing. Your application uses EntityChangedEvent (EntityChangedEvent - CUBA Platform. Developer’s Manual) instead of Entity Listeners (Entity Listeners - CUBA Platform. Developer’s Manual)

Order for EntityChangedEven(phase = TransactionPhase.BEFORE_COMMIT) and BeforeCommitTransactionListener cannot be determined and is not specified in the documentation.

Thank you !

PS: It doesn’t suit me but that’s how it is !