Repository navigation
refactor: decouple Transaction from Jedis - #4440
Merged
Merged
Conversation
Remove direct Jedis reference from Transaction class by introducing protected hook methods onAfterExec() and onAfterDiscard(). Jedis now creates an anonymous Transaction subclass that overrides these hooks to invoke resetState().
Test Resultsβββ308 filesβ Β±0βββββ308 suitesβ Β±0βββ11m 39s β±οΈ -6s Results for commit cc1fe6f.βΒ± Comparison against base commit ae4ed55. This pull request skips 159 tests.β»οΈ This comment has been updated with latest results. |
atakavci
approved these changes
Feb 24, 2026
atakavci
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
lets label it as breaking.
π‘οΈ Jit Security Scan Resultsβ No security findings were detected in this PR
Security scan by Jit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes direct
Jedisreference fromTransactionclass to reduce coupling.Changes
onAfterExec()andonAfterDiscard()inTransactionJedis.multi()now creates an anonymous subclass that overrides these hooks to callresetState()Jedisfield fromTransactionTesting
Verified by TransactionCommandsTest β
Note
Medium Risk
Changes transaction lifecycle cleanup by moving
Jedis.resetState()to hook callbacks, which could affect connection/state handling afterEXEC/DISCARDif any edge cases rely on the old direct reference.Overview
Decouples
TransactionfromJediswhile preserving state cleanup behavior.Transactionno longer stores aJedisreference; instead it exposes protected hooksonAfterExec()andonAfterDiscard()that run in thefinallyblocks ofexec()/discard().Jedis.multi()now creates aTransactionbacked bygetConnection()and overrides those hooks to callresetState(), keeping legacyJedisstate reset semantics without tight coupling.Written by Cursor Bugbot for commit cc1fe6f. This will update automatically on new commits. Configure here.