Skip to content

Conversation

@codeconsole
Copy link
Contributor

@codeconsole codeconsole commented Oct 14, 2025

Hibernate overrides all dirty checking in the GormInstanceApi

https://github.com/apache/grails-core/blob/7.0.x/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/HibernateGormInstanceApi.groovy#L77-L80

which uses hibernate's api for comparing against an internal snapshot.

Currently mongodb does not persist any updates during Events and AutoTimestamp events because the changes are not marked dirty and must be manually marked dirty.

https://grails.apache.org/docs/latest/grails-data/hibernate5/manual/index.html#eventsAutoTimestamping

This fix takes a snapshot before all events and then marks any changes as dirty props to persistence.

@codeconsole codeconsole changed the title 7.0.x mongo pre update snapshot Take snapshot prior to mongo update then mark any changes during beforeUpdate and update events as dirty. Oct 14, 2025
@codeconsole codeconsole requested a review from matrei October 15, 2025 05:41
Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jdaugherty
Copy link
Contributor

Thank you!

@jdaugherty jdaugherty merged commit f4f75fd into apache:7.0.x Oct 15, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants