Skip to content

Commit 387a975

Browse files
fix
1 parent 8fa522a commit 387a975

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

slo/src/AdoNet/SloTableContext.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Data;
22
using Internal;
33
using Ydb.Sdk.Ado;
4+
using Ydb.Sdk.Ado.RetryPolicy;
45

56
namespace AdoNet;
67

@@ -9,7 +10,11 @@ public class SloTableContext : SloTableContext<YdbDataSource>
910
protected override string Job => "AdoNet";
1011

1112
protected override YdbDataSource CreateClient(Config config) => new(
12-
new YdbConnectionStringBuilder(config.ConnectionString) { LoggerFactory = ISloContext.Factory }
13+
new YdbConnectionStringBuilder(config.ConnectionString)
14+
{
15+
LoggerFactory = ISloContext.Factory,
16+
RetryPolicy = new YdbRetryPolicy(new YdbRetryPolicyConfig { EnableRetryIdempotence = true })
17+
}
1318
);
1419

1520
protected override async Task Create(YdbDataSource client, int operationTimeout)

slo/src/Dapper/SloTableContext.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Dapper;
22
using Internal;
33
using Ydb.Sdk.Ado;
4+
using Ydb.Sdk.Ado.RetryPolicy;
45

56
namespace AdoNet.Dapper;
67

@@ -9,7 +10,11 @@ public class SloTableContext : SloTableContext<YdbDataSource>
910
protected override string Job => "Dapper";
1011

1112
protected override YdbDataSource CreateClient(Config config) => new(
12-
new YdbConnectionStringBuilder(config.ConnectionString) { LoggerFactory = ISloContext.Factory }
13+
new YdbConnectionStringBuilder(config.ConnectionString)
14+
{
15+
LoggerFactory = ISloContext.Factory,
16+
RetryPolicy = new YdbRetryPolicy(new YdbRetryPolicyConfig { EnableRetryIdempotence = true })
17+
}
1318
);
1419

1520
protected override async Task Create(YdbDataSource client, int operationTimeout)

0 commit comments

Comments
 (0)