Duplicate entry for key with ReactiveCrudRepository.save
By default, the save() method inspects the identifier property of the given entity. If the identifier property is null, then the entity is assumed to be new. Otherwise, it is assumed exist in the datbase.
But got error:Duplicate entry for key,why?
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem.
Please also verify your expectations against the Entity State detection strategies.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
@GeneratedValue(strategy = GenerationType.IDENTITY) is a JPA annotation that isn't considered by R2DBC.
Please provide a minimal runnable sample that can reproduce your problem so we can investigate what is going on.
With the code above, I'm not able to reproduce the issue, which is why I was asking for a reproducer. Without a way to reproduce the problem, this ticket isn't actionable.