Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXPOSED-689 warmUpLinkedReferences() should not return all the values from cache #2355

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

obabichevjb
Copy link
Collaborator

Description

Summary of the change: Provide a concise summary of this PR. Describe the changes made in a single sentence or short paragraph.

Detailed description:

  • What: The method EntityClass::warmUpLinkedReferences() was filling the cache by values from references argument and returning after that all the values from cache. As a result on the second call with a new list of references the wrong result was returned (all the values from the cache were returned)
  • How: The solution is to filter cache values by the values from references argument and return the filtered result.

Type of Change

  • Bug fix

Affected databases:

  • All

Related Issues

EXPOSED-689 warmUpLinkedReferences() should not return all the values from cache

@obabichevjb obabichevjb requested a review from bog-walk January 14, 2025 13:54
Copy link
Member

@bog-walk bog-walk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@obabichevjb Re the failing test:

I've had similar fails with SQL Server when attempting a batch insert into a single column IdTable. I never checked if it's ultimately an Exposed issue or a SQL Server peculiarity.

I usually just avoid it by adding at least 1 column other than id or manually providing the id value. The latter is tedious though because the required SET IDENTITY_INSERT command needs to be run as a single statement batch before INSERT.

@obabichevjb obabichevjb force-pushed the obabichev/exposed-689-warm-up-references-fix branch from 26d35c4 to 9bd22b9 Compare January 20, 2025 09:50
@obabichevjb obabichevjb force-pushed the obabichev/exposed-689-warm-up-references-fix branch from 9bd22b9 to 938378b Compare January 20, 2025 10:06
@obabichevjb obabichevjb merged commit 36501a5 into main Jan 20, 2025
5 checks passed
@obabichevjb obabichevjb deleted the obabichev/exposed-689-warm-up-references-fix branch January 20, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants