Skip to content

Loading…

DDC-414: Improve Performance of onUpdate Event Listeners #4907

Closed
doctrinebot opened this Issue · 7 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

Currently both onUpdate lifecycle events and event listeners trigger the recomputeEntityChangeSets method.

I would suggest to change the event listeners to only recieve a reference of the changeset and not computing the differences for each affected entity. This could improve performance considerably in the onUpdate event case and would be more helpful for users to understand how limited the onUpdate event listener really is.

@doctrinebot

Comment created by @beberlei:

Another valid approach would be to require an explicit call to recomputeEntityChangeSets from an onUpdate listener.

I think both use-cases could be supported.

@doctrinebot

Comment created by @beberlei:

This would be a BC break, so implementation before Beta 1 seems a necessary must

@doctrinebot

Comment created by romanb:

Well, ok, we can still have BC breaks during BETA though, only once we hit RC the API is frozen.

@doctrinebot

Comment created by @beberlei:

Attached is a proposed implementation example

@doctrinebot

Comment created by @beberlei:

Implemented, notes in UPGRADETO_20:

## Change of PreUpdate Event Listener

Event Listeners listening to the 'preUpdate' event can only affect the primitive values of entity changesets
by using the API on the `PreUpdateEventArgs` instance passed to the preUpdate listener method. Any changes
to the state of the entitys properties won't affect the database UPDATE statement anymore. This gives drastic
performance benefits for the preUpdate event.
@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-BETA1 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.