Join columns might keep reference to some previously associated, but then deleted, entities

Description

In case of @OneToMany bidirectional associations, without any definitions of cascade. When we delete the entity owner, it might happen that the associates entities would still keep the reference to the, now deleted, entity owner.
Thus, if we try to create another entity owner, recycling the id owned by the former, we could have associations, between the latter and associated entities, never defined by the user.

This seems affect only grid and document dialects, such as MongoDB or Infinispan. On the other hand, graph dialects, like Neo4j, have no issue. Probabily because the latters do not need to handle the inverses of bidirectional associations.
Test case:

Environment

None

Activity

Show:
Fabio Massimo Ercoli
July 20, 2018, 5:04 PM

Actually there is no reason to change current behavior. In fact most NoSql databases ha no concept of referential integrity. Thus it will be a task of the user to update both references, in order to keep data consistent.

In consequence, we will close the issue as "Won't Fix",

Fabio Massimo Ercoli
July 20, 2018, 5:07 PM

Before closing the issue as Won't fix maybe we can add this test.

Davide D'Alto
August 7, 2018, 10:57 PM

When dealing with bi-directional association is important that the user applies operations on both side of the association

Won't Fix

Assignee

Fabio Massimo Ercoli

Reporter

Fabio Massimo Ercoli

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Major