Skip to content

Order JDBC principal session rows by primary key - #4069

Open
AlexanderReaper7 wants to merge 1 commit into
spring-projects:3.5.xfrom
AlexanderReaper7:fix/3452-jdbc-principal-session-order
Open

AlexanderReaper7 wants to merge 1 commit into
spring-projects:3.5.xfrom
AlexanderReaper7:fix/3452-jdbc-principal-session-order

Conversation

@AlexanderReaper7

Copy link
Copy Markdown

The default principal-name query can return a session's attribute rows in separate groups. SessionResultSetExtractor combines only adjacent rows, so a later group creates a partial session that replaces the earlier one in the result map.

Add ORDER BY S.PRIMARY_ID to keep every session's rows adjacent. A PostgreSQL integration test saves 120 sessions, adds an attribute to every third session in a later save, runs ANALYZE, and checks every listed session's attribute names and values against findById. Without the ordering, the regression fails because a listed session contains only later instead of all five stored attributes. With the ordering, it passes.

Closes #3452

Targets 3.5.x, the oldest supported maintenance branch listed in the open milestones, as required by CONTRIBUTING.adoc.

Validation ran in Docker with Temurin 17.0.20.1 and the repository's PostgreSQL 14.5 container:

  • The new regression fails without the fix and passes with it.
  • All 142 JDBC unit tests and 38 PostgreSQL repository integration tests pass.
  • checkstyleMain, checkstyleIntegrationTest and checkFormat pass.

Other database integration suites and the full multi-module build were not run.

Keep each session's attribute rows adjacent for SessionResultSetExtractor. Add a PostgreSQL regression that compares principal lookups with findById after attributes are added in later saves.

Closes spring-projectsgh-3452

Signed-off-by: Alexander Öberg <stativetroller7@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants