Skip to content

added retry logic to detect and recover from stale connections#29

Merged
MatteoDelOmbra merged 10 commits into
masterfrom
FSPES-129
May 28, 2026
Merged

added retry logic to detect and recover from stale connections#29
MatteoDelOmbra merged 10 commits into
masterfrom
FSPES-129

Conversation

@MichalFrends1

@MichalFrends1 MichalFrends1 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Please review my changes :)

Review Checklist

  • Task version updated (x.x.0)
  • CHANGELOG.md updated
  • Solution builds
  • Warnings resolved (if possible)
  • Typos resolved
  • Tests cover new code
  • Description how to run tests locally added to README.md (if needed)
  • All tests pass locally

Summary by CodeRabbit

  • New Features
    • Configurable automatic retry for recovering stale Oracle connections (retry attempts and retry delay).
  • Bug Fixes
    • Procedure execution now automatically retries and recovers from stale cached Oracle connections after an Oracle server restart.
  • Tests
    • Added integration and unit tests covering cached-connection recovery and invalid-SQL behaviors.
  • Documentation
    • Changelog updated and package version bumped to 2.5.0.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@MichalFrends1, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 1 second. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 123359df-93c9-4886-a86a-e73477487853

📥 Commits

Reviewing files that changed from the base of the PR and between 0bc9d34 and e5598ac.

📒 Files selected for processing (2)
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Definitions/Options.cs
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs

Walkthrough

ExecuteProcedure is refactored to retry executions on stale/lost Oracle connections using new options ConnectionRetryAttempts and ConnectionRetryDelayMs. New helpers obtain or recreate connections, detect stale errors, clear pools/cache and optionally delay between retries. Tests, changelog, and project version are updated.

Changes

Stale Connection Recovery and Retry

Layer / File(s) Summary
Retry logic and connection helpers
Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs
Implements an attempt-based retry loop driven by ConnectionRetryAttempts; obtains connections via GetOrCreateConnectionAsync, classifies stale errors with IsStaleConnectionException, performs pool/cache clearing and optional delay via RetryOnStaleConnection, and handles exhausted retries with HandleRetryExhausted. Includes per-attempt cleanup respecting CloseConnection and ClearConnectionPools.
Test helper and integration/unit tests
Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/Lib/Helpers.cs, Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs
Adds CreateTestProcedure helper and integration test ExecuteProcedure_WithCachedConnection_RecoversAfterOracleRestart that validates execution before and after an Oracle container restart using cached-connection settings; adds two tests covering invalid-SQL behavior with ThrowErrorOnFailure true/false.
Options, changelog and project version
Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Definitions/Options.cs, Frends.Oracle.ExecuteProcedure/CHANGELOG.md, Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.csproj
Adds ConnectionRetryAttempts (default 2, range 1–5) and ConnectionRetryDelayMs (default 100ms) to Options, documents the 2.5.0 changelog entry describing the added retry behavior and fix, and bumps package version to 2.5.0.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • MatteoDelOmbra

Poem

🐰 In burrows of code I softly hop,

When Oracle falls and connections stop,
I nudge a retry, clear the old cache,
Delay a beat — then watch queries dash,
A happy rabbit cheers: "Reconnect, hop!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'added retry logic to detect and recover from stale connections' accurately describes the main change across the changeset, which adds configurable retry behavior with ConnectionRetryAttempts and ConnectionRetryDelayMs properties and implements stale-connection detection/recovery logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch FSPES-129

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs (2)

737-739: ⚡ Quick win

Shared _options mutation may cause test isolation issues.

The test modifies the shared static _options instance without restoring original values. If tests run in parallel or a subsequent test assumes different default values, this could cause flaky failures.

Consider using a local Options instance instead:

Proposed fix
+        var options = new Options
+        {
+            ThrowErrorOnFailure = true,
+            TimeoutSeconds = 30,
+            BindParameterByName = true,
+            CloseConnection = false,
+            ClearConnectionPools = false
+        };
-        _options.CloseConnection = false;
-        _options.ClearConnectionPools = false;
-        _options.ThrowErrorOnFailure = true;

-        var result1 = await Oracle.ExecuteProcedure(_input, output, _options, CancellationToken.None);
+        var result1 = await Oracle.ExecuteProcedure(_input, output, options, CancellationToken.None);
         ...
-        var result2 = await Oracle.ExecuteProcedure(_input, output, _options, CancellationToken.None);
+        var result2 = await Oracle.ExecuteProcedure(_input, output, options, CancellationToken.None);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs`
around lines 737 - 739, The test mutates the shared static _options which can
break test isolation; instead create and use a fresh local Options instance
(e.g., var options = new Options { CloseConnection = false, ClearConnectionPools
= false, ThrowErrorOnFailure = true }) for this test and pass that local
instance into the method under test (or replace uses of _options within this
test with the new local variable), or if you must reuse _options save its
original property values and restore them in a finally/teardown block;
specifically change references to _options.CloseConnection,
_options.ClearConnectionPools and _options.ThrowErrorOnFailure in this test to
operate on the local options variable (or ensure restoration) to avoid
cross-test side effects.

746-760: 💤 Low value

Test leaves connection cached after completion—may affect other tests.

The test intentionally keeps CloseConnection = false but doesn't clean up the cached connection afterward. The TearDown method calls DropTestTable and DropProcedure, but the stale cached connection to test_user remains. If subsequent tests expect a fresh connection state, they may fail.

Consider adding cleanup at the end:

Proposed cleanup
         var result2 = await Oracle.ExecuteProcedure(_input, output, _options, CancellationToken.None);
         ClassicAssert.IsTrue(result2.Success);
         var dict2 = (Dictionary<string, object>)result2.Output;
         ClassicAssert.AreEqual("haapatie 9", dict2["address"]);
+
+        // Cleanup: close cached connection for subsequent tests
+        var cleanupOptions = new Options
+        {
+            ThrowErrorOnFailure = false,
+            CloseConnection = true,
+            ClearConnectionPools = true
+        };
+        await Oracle.ExecuteProcedure(_input, output, cleanupOptions, CancellationToken.None);
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs`
around lines 746 - 760, The test leaves a cached connection for the test_user
because CloseConnection = false, so after creating the test user/table/procedure
you must clear the pooled/stale connection to avoid affecting later tests; after
the recreateCon block (or in TearDown alongside DropTestTable and DropProcedure)
call the appropriate pool-clear routine (e.g.,
OracleConnection.ClearPool(recreateCon) or OracleConnection.ClearAllPools()) or
explicitly close/dispose any cached connection for test_user so the cached
connection is removed and later tests get a fresh connection state.
Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs (1)

154-162: 💤 Low value

Potential infinite recursion if GetLazyConnection returns a stale connection twice.

When IsStaleConnectionException is caught, the code clears the cache and pools, then calls GetLazyConnection again and attempts OpenAsync. If this second OpenAsync also throws a stale connection exception, it will propagate unhandled, which is acceptable. However, there's a subtle issue: the new Lazy<OracleConnection> from GetLazyConnection might still reference a bad pool state if ClearAllPools hasn't fully completed. Consider awaiting a brief delay or documenting this limitation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs`
around lines 154 - 162, The catch for IsStaleConnectionException can recreate a
Lazy<OracleConnection> via GetLazyConnection and immediately call con.OpenAsync
which can fail again if pools aren't fully cleared; modify the logic in the
catch block handling IsStaleConnectionException to perform a bounded retry:
remove the stale cache entry (LazyConnectionCache.TryRemove), call
OracleConnection.ClearAllPools(), then recreate the connection with
GetLazyConnection and attempt OpenAsync with a small exponential backoff (e.g.,
delay 100–500ms) and a max retry count (e.g., 2–3 attempts) before letting the
exception propagate; reference GetLazyConnection, LazyConnectionCache,
OracleConnection.ClearAllPools, IsStaleConnectionException and con.OpenAsync
when implementing the retry/delay to avoid repeating stale connections.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/Lib/Helpers.cs`:
- Around line 91-95: The PL/SQL procedure created in Helpers.cs uses the
parameter name "name" which is shadowed by the table column `name` in the query
`where name = name`; change the parameter or qualify the column so the
right-hand side refers to the parameter (for example rename the parameter to
`p_name` or prefix it, or use a table alias like `w.name = name`) and update the
procedure creation string in the method that builds `procedureName` accordingly;
also fix the same shadowing occurrences in the inline procedure definitions in
UnitTests.cs so tests actually filter by the input parameter rather than the
column.

In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs`:
- Around line 59-69: The IsFaulted check after calling
command.ExecuteNonQueryAsync(cancellationToken) is unreliable/dead code; remove
the entire if (runCommand.IsFaulted) { ... } block and let awaiting the
Task<int> (runCommand) propagate exceptions to the existing catch handler. Keep
the call to ExecuteNonQueryAsync and the await var rowsAffected = await
runCommand; and rely on the existing catch to handle errors and use
options.ThrowErrorOnFailure / new Result(...) there rather than inspecting
runCommand.IsFaulted.
- Around line 103-104: The current throws use ArgumentException("Error when
executing command:", ex.Message) which passes ex.Message as paramName and loses
the original exception; update both occurrences (the throw inside the
options.ThrowErrorOnFailure branch and the similar throw at the later location)
to construct the ArgumentException with the caught exception as the inner
exception (pass the Exception object, not ex.Message) so the original stack and
message are preserved (e.g., use the overload that accepts an inner exception),
keeping the descriptive message "Error when executing command" and the original
exception as innerException.

---

Nitpick comments:
In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs`:
- Around line 737-739: The test mutates the shared static _options which can
break test isolation; instead create and use a fresh local Options instance
(e.g., var options = new Options { CloseConnection = false, ClearConnectionPools
= false, ThrowErrorOnFailure = true }) for this test and pass that local
instance into the method under test (or replace uses of _options within this
test with the new local variable), or if you must reuse _options save its
original property values and restore them in a finally/teardown block;
specifically change references to _options.CloseConnection,
_options.ClearConnectionPools and _options.ThrowErrorOnFailure in this test to
operate on the local options variable (or ensure restoration) to avoid
cross-test side effects.
- Around line 746-760: The test leaves a cached connection for the test_user
because CloseConnection = false, so after creating the test user/table/procedure
you must clear the pooled/stale connection to avoid affecting later tests; after
the recreateCon block (or in TearDown alongside DropTestTable and DropProcedure)
call the appropriate pool-clear routine (e.g.,
OracleConnection.ClearPool(recreateCon) or OracleConnection.ClearAllPools()) or
explicitly close/dispose any cached connection for test_user so the cached
connection is removed and later tests get a fresh connection state.

In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs`:
- Around line 154-162: The catch for IsStaleConnectionException can recreate a
Lazy<OracleConnection> via GetLazyConnection and immediately call con.OpenAsync
which can fail again if pools aren't fully cleared; modify the logic in the
catch block handling IsStaleConnectionException to perform a bounded retry:
remove the stale cache entry (LazyConnectionCache.TryRemove), call
OracleConnection.ClearAllPools(), then recreate the connection with
GetLazyConnection and attempt OpenAsync with a small exponential backoff (e.g.,
delay 100–500ms) and a max retry count (e.g., 2–3 attempts) before letting the
exception propagate; reference GetLazyConnection, LazyConnectionCache,
OracleConnection.ClearAllPools, IsStaleConnectionException and con.OpenAsync
when implementing the retry/delay to avoid repeating stale connections.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 845eab61-7a1d-4a7a-bf49-af50acf0032d

📥 Commits

Reviewing files that changed from the base of the PR and between 593a38a and e6ae1cd.

📒 Files selected for processing (5)
  • Frends.Oracle.ExecuteProcedure/CHANGELOG.md
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/Lib/Helpers.cs
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.csproj

{
var con = GetLazyConnection(input.ConnectionString);
await using var command = new OracleCommand();
const int maxAttempts = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to to options, so user can set another value if he wants (describe in summary what case is handles by thsi retry). Additionally add delay (also customizable by user) between attempts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs (1)

307-317: 💤 Low value

Unused method overload.

This synchronous overload is never called—only the async version with delayMs (lines 319-333) is invoked at line 95. Consider removing this dead code.

🧹 Proposed removal
-    [ExcludeFromCodeCoverage]
-    private static bool RetryOnStaleConnection(Exception ex, int attempt, int maxAttempts, string connectionString)
-    {
-        if (attempt < maxAttempts && IsStaleConnectionException(ex))
-        {
-            LazyConnectionCache.TryRemove(connectionString, out _);
-            OracleConnection.ClearAllPools();
-            return true;
-        }
-        return false;
-    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs`
around lines 307 - 317, Remove the dead synchronous overload
RetryOnStaleConnection(Exception ex, int attempt, int maxAttempts, string
connectionString) because only the async overload with delayMs is ever used;
delete this method and any internal references to
LazyConnectionCache.TryRemove(...) and OracleConnection.ClearAllPools() within
it, or consolidate its logic into the single async RetryOnStaleConnection(...)
if you intended a unified implementation; after removal, rebuild and run tests
to confirm no callers remain (search for RetryOnStaleConnection to verify).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs`:
- Around line 797-815: The test
ExecuteProcedure_WithInvalidSql_ThrowsExceptionWhenThrowErrorOnFailureTrue must
be made async and must await the Assert.ThrowsAsync call; change the method
signature to "public async Task
ExecuteProcedure_WithInvalidSql_ThrowsExceptionWhenThrowErrorOnFailureTrue()"
and await the assertion like "var ex = await Assert.ThrowsAsync<Exception>(async
() => await Oracle.ExecuteProcedure(_input, output, _options,
CancellationToken.None));" so the exception task is observed and the test
correctly fails on assertion failures.

---

Nitpick comments:
In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs`:
- Around line 307-317: Remove the dead synchronous overload
RetryOnStaleConnection(Exception ex, int attempt, int maxAttempts, string
connectionString) because only the async overload with delayMs is ever used;
delete this method and any internal references to
LazyConnectionCache.TryRemove(...) and OracleConnection.ClearAllPools() within
it, or consolidate its logic into the single async RetryOnStaleConnection(...)
if you intended a unified implementation; after removal, rebuild and run tests
to confirm no callers remain (search for RetryOnStaleConnection to verify).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3fdd3ff7-f46c-4226-9a5c-6f3821e2f0f7

📥 Commits

Reviewing files that changed from the base of the PR and between f7b8f6d and 0bc9d34.

📒 Files selected for processing (5)
  • Frends.Oracle.ExecuteProcedure/CHANGELOG.md
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/Lib/Helpers.cs
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Definitions/Options.cs
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.cs
✅ Files skipped from review due to trivial changes (1)
  • Frends.Oracle.ExecuteProcedure/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/Lib/Helpers.cs

Comment on lines +797 to +815
[Test]
public void ExecuteProcedure_WithInvalidSql_ThrowsExceptionWhenThrowErrorOnFailureTrue()
{
_input.Command = "INVALID SQL SYNTAX HERE";
_input.CommandType = OracleCommandType.Command;

var output = new Output
{
DataReturnType = OracleCommandReturnType.AffectedRows
};

_options.ThrowErrorOnFailure = true;

var ex = Assert.ThrowsAsync<Exception>(async () =>
await Oracle.ExecuteProcedure(_input, output, _options, CancellationToken.None));

ClassicAssert.IsNotNull(ex);
ClassicAssert.IsTrue(ex.Message.Contains("Error when executing command"));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Assert.ThrowsAsync must be awaited; test method must be async.

Assert.ThrowsAsync<T> returns Task<T>, not T. Without awaiting, the test completes before the async operation finishes, potentially passing even when the assertion fails. The method must be async Task and the assertion must be awaited.

🐛 Proposed fix
     [Test]
-    public void ExecuteProcedure_WithInvalidSql_ThrowsExceptionWhenThrowErrorOnFailureTrue()
+    public async Task ExecuteProcedure_WithInvalidSql_ThrowsExceptionWhenThrowErrorOnFailureTrue()
     {
         _input.Command = "INVALID SQL SYNTAX HERE";
         _input.CommandType = OracleCommandType.Command;

         var output = new Output
         {
             DataReturnType = OracleCommandReturnType.AffectedRows
         };

         _options.ThrowErrorOnFailure = true;

-        var ex = Assert.ThrowsAsync<Exception>(async () =>
+        var ex = await Assert.ThrowsAsync<Exception>(async () =>
             await Oracle.ExecuteProcedure(_input, output, _options, CancellationToken.None));

         ClassicAssert.IsNotNull(ex);
         ClassicAssert.IsTrue(ex.Message.Contains("Error when executing command"));
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Frends.Oracle.ExecuteProcedure/Frends.Oracle.ExecuteProcedure.Tests/UnitTests.cs`
around lines 797 - 815, The test
ExecuteProcedure_WithInvalidSql_ThrowsExceptionWhenThrowErrorOnFailureTrue must
be made async and must await the Assert.ThrowsAsync call; change the method
signature to "public async Task
ExecuteProcedure_WithInvalidSql_ThrowsExceptionWhenThrowErrorOnFailureTrue()"
and await the assertion like "var ex = await Assert.ThrowsAsync<Exception>(async
() => await Oracle.ExecuteProcedure(_input, output, _options,
CancellationToken.None));" so the exception task is observed and the test
correctly fails on assertion failures.


/// <summary>
/// Maximum number of retry attempts when encountering stale Oracle connections after server restart.
/// Valid values: 1-5. Value of 1 means no retry.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change code logic then - As a user if I put 1 retry attempts I expect 1 retry attempt not 0 xd

@MatteoDelOmbra MatteoDelOmbra merged commit afc801f into master May 28, 2026
7 checks passed
@MatteoDelOmbra MatteoDelOmbra deleted the FSPES-129 branch May 28, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants