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

Map storage looks up ID via the session, that is no longer needed #12381

Closed
ahus1 opened this issue Jun 7, 2022 · 0 comments · Fixed by #14000
Closed

Map storage looks up ID via the session, that is no longer needed #12381

ahus1 opened this issue Jun 7, 2022 · 0 comments · Fixed by #14000
Assignees
Labels
area/storage Indicates an issue that touches storage (change in data layout or data manipulation) kind/bug Categorizes a PR related to a bug status/triage
Milestone

Comments

@ahus1
Copy link
Contributor

ahus1 commented Jun 7, 2022

Describe the bug

The following example first looks up the realmId, then looks it up via the session again.

String roleId = tx.read(withCriteria(mcb))
.map(entityToAdapterFunc(realm))
.map(RoleModel::getId)
.findFirst()
.orElse(null);
//we need to go via session.roles() not to bypass cache
return roleId == null ? null : session.roles().getRoleById(realm, roleId);

Such a behavior will lead to problem in a tree store, where a partial store should return only its partial results.

Version

999-SNAPSHOT

Expected behavior

As no caches are in place outside of the map store, this behavior is now no longer needed. All legacy caches are disabled.

Actual behavior

Additional lookup by ID

@ahus1 ahus1 added kind/bug Categorizes a PR related to a bug area/storage Indicates an issue that touches storage (change in data layout or data manipulation) team/storage-sig status/triage labels Jun 7, 2022
@ahus1 ahus1 self-assigned this Jun 7, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Jun 7, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Jun 8, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Jun 9, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Aug 23, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Aug 24, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Aug 25, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Aug 25, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Aug 25, 2022
ahus1 added a commit to ahus1/keycloak that referenced this issue Aug 29, 2022
agaman1792 pushed a commit to agaman1792/keycloak that referenced this issue Aug 30, 2022
@stianst stianst added this to the 20.0.0 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage Indicates an issue that touches storage (change in data layout or data manipulation) kind/bug Categorizes a PR related to a bug status/triage
Projects
None yet
2 participants