Skip to content

Fix UnifiedJedis watch transaction state#3398

Open
hutiefang76 wants to merge 1 commit into
spring-projects:mainfrom
hutiefang76:codex/sdr-3392-watch-multi-results
Open

Fix UnifiedJedis watch transaction state#3398
hutiefang76 wants to merge 1 commit into
spring-projects:mainfrom
hutiefang76:codex/sdr-3392-watch-multi-results

Conversation

@hutiefang76

Copy link
Copy Markdown

Fixes #3392

UnifiedJedis.watch() pins a connection by creating a transaction object before MULTI. The connection therefore reported queueing too early, so reads between WATCH and MULTI polluted the expected EXEC result count.

This change distinguishes WATCH-only state from an active MULTI transaction. Commands before MULTI run immediately on the pinned connection, while incompatible pipeline, subscription, and cursor operations are rejected.

Tests cover typed and raw reads, EXEC result alignment, pipeline/subscription guards, and SCAN variants. The focused Jedis suite passes 813 tests with 0 failures or errors (64 skipped).

I used AI-assisted review for edge-case analysis and verified the root cause, implementation, and tests locally.

  • I have read the Spring Data contribution guidelines.
  • I applied the project formatter/checkstyle without unrelated formatting changes.
  • I added unit and integration tests.
  • I added myself as author in every touched class.

Closes spring-projects#3392

Signed-off-by: hutiefang76 <137664623+hutiefang76@users.noreply.github.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 11, 2026
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.

Transaction with a read before MULTI fails with "Incorrect number of transaction results" on 4.1.0 (regression from 4.0.x)

2 participants