Skip to content

DuplicateKeyException on save lazy loaded references #5031

@MuravlevAS

Description

@MuravlevAS

Mongo repository throws DuplicateKeyException when I use save() method with object that was lazily loaded
from @DocumentReference

spring-data-mongodb version: 4.5.1

Failing test in demo project that shows the bug:
https://github.com/MuravlevAS/spring-mongodb-reference-demo/blob/master/src/test/java/com/example/demo/Demo1ApplicationTests.java#L25-L45

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions