Skip to content

7.0.0-RC2: @AutoTimestamp and lastUpdated not persisting correctly with Mongo DB #15120

@codeconsole

Description

@codeconsole

Expected Behavior

@AutoTimestamp should update every save that has modified data.

Actual Behaviour

date is updated on the domain object, but not persisted to the database even when other updated properties are persisted correctly.

Steps To Reproduce

git clone --depth 1 --single-branch https://github.com/codeconsole/mongo-test && cd mongo-test && ./gradlew bootRun

Create a new User http://localhost:8080/user/create
Notate Last Updated and Modified dates.

Bug 1

Edit the user http://localhost:8080/user/edit/1 and change the name.
Notice only Last Updated is change and NOT Modified.

Bug 2

Edit the user http://localhost:8080/user/edit/1 and DO NOT change the name. Just Save
Notate Last Updated and Modified dates are BOTH modified. Neither should change because there are no updates.

The behavior with hibernate leaves both dates unchanged.
You can verify by stopping the app and checking out the h2 branch.

Example Application

https://github.com/codeconsole/mongo-test

Version

7.0.0-RC2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions