-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pool/SNOW-937183 Prevent evicted connections from returning to the po…
…ol (#912) ### Description Prevent evicted connections from returning to the pool ### Checklist - [x] Code compiles correctly - [x] Code is formatted according to [Coding Conventions](../blob/master/CodingConventions.md) - [x] Created tests which fail without the change (if possible) - [x] All tests passing (`dotnet test`) - [x] Extended the README / documentation, if necessary - [x] Provide JIRA issue id (if possible) or GitHub issue id in PR name
- Loading branch information
1 parent
b842cbd
commit 7db9d54
Showing
15 changed files
with
262 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Moq; | ||
using Snowflake.Data.Client; | ||
using Snowflake.Data.Core; | ||
|
||
namespace Snowflake.Data.Tests.Mock | ||
{ | ||
public static class MockHelper | ||
{ | ||
public static Mock<SnowflakeDbCommand> CommandThrowingExceptionOnlyForRollback() | ||
{ | ||
var command = new Mock<SnowflakeDbCommand>(); | ||
command.CallBase = true; | ||
command.SetupSet(it => it.CommandText = "ROLLBACK") | ||
.Throws(new SnowflakeDbException(SFError.INTERNAL_ERROR, "Unexpected failure on transaction rollback when connection is returned to the pool with pending transaction")); | ||
return command; | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Data.Common; | ||
using Snowflake.Data.Client; | ||
|
||
namespace Snowflake.Data.Tests.Mock | ||
{ | ||
public class TestSnowflakeDbConnection : SnowflakeDbConnection | ||
{ | ||
public TestSnowflakeDbConnection(DbProviderFactory dbProviderFactory) | ||
{ | ||
DbProviderFactory = dbProviderFactory; | ||
} | ||
|
||
protected override DbProviderFactory DbProviderFactory { get; } | ||
} | ||
} |
Oops, something went wrong.