Skip to content

Conversation

@DavideBicego
Copy link
Contributor

@DavideBicego DavideBicego commented Sep 25, 2024

Having a one to one join with a single table inheritance entity i have issues when the proxy __load results in not having an associated tuple in the joined table.
The given exception is:

Doctrine\ORM\Exception\EntityIdentityCollisionException: While adding an entity of class KanbanBOX\Core\Card\Domain\Model\CardVersion with an ID hash of "256" to the identity map,
another object of class DoctrineProxies\__CG__\KanbanBOX\Core\Card\Domain\Model\CardVersion was already present for the same ID. This exception
is a safeguard against an internal inconsistency - IDs should uniquely map to
entity object instances. This problem may occur if:

- you use application-provided IDs and reuse ID values;
- database-provided IDs are reassigned after truncating the database without
clearing the EntityManager;
- you might have been using EntityManager#getReference() to create a reference
for a nonexistent ID that was subsequently (by the RDBMS) assigned to another
entity.

Otherwise, it might be an ORM-internal inconsistency, please report it.

I'm having problems simulating my issue in Doctrine/ORM testing environment since the test is creating a FOREIGN KEY based on mapping that makes the test fail.
In our real scenario we have a database first approach so we don't really have foreign key constraints.

@DavideBicego DavideBicego changed the title Adds testing to simulate the issue Issue with single table inheritance and association keys Sep 25, 2024
@github-actions
Copy link
Contributor

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@github-actions github-actions bot added the Stale label Dec 25, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2025

This pull request was closed due to inactivity.

@github-actions github-actions bot closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant