Skip to content

Unnecessary update on entity when using LoadStrategy.JOINED #1334

@Langstra

Description

@Langstra

Describe the bug
Example:
Project has Collection of Radio

We load a radio (call it radio1) from the database with together with a project (call it project1). Then we create a new project or do something else and we persistAndFlush it. Then it also finds a diff on radio1 that the project_id has changed to project1.id. This is weird, since it has not changed.

This triggers an additional and unnecessary query to update radio1.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout PR 1333
  2. yarn test GH1334
  3. ...

Expected behavior
Should not trigger an update query on radio1

Additional context
When setting the LoadStrategy to SELECT_IN it does not trigger the additional update query

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions