jamesfredley commented on issue #14662: URL: https://github.com/apache/grails-core/issues/14662#issuecomment-5960523602
The listener still overwrites `dateCreated` on every insert. That is intentional. Reading the current value before writing it was rejected because it would slow down large writes: https://github.com/apache/grails-core/issues/14662#issuecomment-267890099 The reason in the report, inserting a known `dateCreated` or `lastUpdated` from a test or an import, is supported by temporarily turning the listener off. Inject `autoTimestampEventListener` and call `withoutDateCreated`, `withoutLastUpdated`, or `withoutTimestamps`. The save has to be flushed inside the closure. That API is on `AutoTimestampEventListener` in the 7.0.0 line through 7.2.4, in `v8.0.0-M1` through `v8.0.0-RC2`, and on `8.1.x` and `9.0.x`. 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]
