Fix RepositoryConnection.getIsolationLevel() returning null when isolation level is set#5494
Draft
Fix RepositoryConnection.getIsolationLevel() returning null when isolation level is set#5494
Conversation
…olationLevel() Co-authored-by: hmottestad <797185+hmottestad@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Isolation level is always null, if queried from the RepositoryConnection
Fix RepositoryConnection.getIsolationLevel() returning null when isolation level is set
Oct 5, 2025
Contributor
|
@copilot remove initial-evidence.txt |
Co-authored-by: hmottestad <797185+hmottestad@users.noreply.github.com>
Author
Contributor
|
@copilot add a test where the isolation level is not explicitly specified by the user, which means that the default isolation level is used. Only add the test! |
Co-authored-by: hmottestad <797185+hmottestad@users.noreply.github.com>
Author
Added test |
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.
Fixed issue where
RepositoryConnection#getIsolationLevel()was always returning null even when an isolation level was set viabegin(IsolationLevel).Root Cause:
SailRepositoryConnectionoverridesbegin(IsolationLevel)andbegin(TransactionSetting...)but doesn't callsetIsolationLevel()to update the AbstractRepositoryConnection'sisolationLevelfield that is returned bygetIsolationLevel().Solution: Modified both methods in SailRepositoryConnection to call
setIsolationLevel()before starting the transaction.Changes Made
SailRepositoryConnection.begin(IsolationLevel level)to callsetIsolationLevel(level)SailRepositoryConnection.begin(TransactionSetting... settings)to callsetIsolationLevel()for isolation level settingstestGetIsolationLevel_shouldReturnSetLevel- Tests explicit isolation level setting viabegin(IsolationLevel)testGetIsolationLevel_shouldReturnSetLevelFromTransactionSettings- Tests isolation level viabegin(TransactionSetting...)testGetIsolationLevel_shouldReturnDefaultLevelWhenNotExplicitlySet- Tests that default isolation level is returned whenbegin()is called without parameters (currently failing, demonstrates additional issue)Testing
begin()without parameters doesn't properly set isolation level)The fix is minimal and surgical - it only adds the missing
setIsolationLevel()call that should have been there. This ensures thatgetIsolationLevel()properly returns the isolation level that was set when beginning a transaction. The additional test case reveals that there's still an issue with the default isolation level behavior that may need to be addressed separately.Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.