jamesfredley commented on issue #14646: URL: https://github.com/apache/grails-core/issues/14646#issuecomment-5962640724
This is the flush behavior, not a separate notification for each business save. A transaction commit flushes the Hibernate session, and that flush publishes a persistence event for each persisted entity, including cascades. Graeme Rocher noted that on the issue: the events come from Hibernate and are triggered by the flush a transaction performs. On Hibernate 7 those events are `PersistEvent` and `MergeEvent`. `PersistEvent` is published for an explicit `save()` and again for a cascaded persist when the session flushes. On Hibernate 5 the corresponding event is `SaveOrUpdateEvent`. For a single insert or update, use `PostInsert` or `PostUpdate` rather than treating every flush event as a new save. https://grails.apache.org/docs/latest/grails-data/hibernate7/manual/index.html#eventsAutoTimestamping -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
