We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a70272e + 9f5c2cd commit b22423aCopy full SHA for b22423a
Extensions/Xtensive.Orm.BulkOperations/Internals/Operation.cs
@@ -50,7 +50,15 @@ public async Task<int> ExecuteAsync(CancellationToken token = default)
50
return value;
51
}
52
53
- protected void EnsureTransactionIsStarted() => Transaction.Require(QueryProvider.Session);
+ protected void EnsureTransactionIsStarted()
54
+ {
55
+ Transaction.Require(QueryProvider.Session);
56
+#pragma warning disable 168
57
+ // this prepares connection which ensures that connection is opened
58
+ // this is weird way but it is required for some scenarios.
59
+ _ = QueryProvider.Session.Services.Demand<DirectSqlAccessor>().Transaction;
60
+#pragma warning restore 168
61
+ }
62
63
protected abstract int ExecuteInternal();
64
0 commit comments