Skip to content

Commit 60177a3

Browse files
authored
Merge pull request #165 from DataObjects-NET/6.0-bulk-extension-transaction-check
Add transaction existence requirement for bulk operations
2 parents 9d3e71c + c896e41 commit 60177a3

File tree

1 file changed

+2
-8
lines changed
  • Extensions/Xtensive.Orm.BulkOperations/Internals

1 file changed

+2
-8
lines changed

Extensions/Xtensive.Orm.BulkOperations/Internals/Operation.cs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2020 Xtensive LLC.
1+
// Copyright (C) 2019-2021 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44

@@ -45,13 +45,7 @@ public int Execute()
4545

4646
#region Non-public methods
4747

48-
protected void EnsureTransactionIsStarted()
49-
{
50-
var accessor = QueryProvider.Session.Services.Demand<DirectSqlAccessor>();
51-
#pragma warning disable 168
52-
var notUsed = accessor.Transaction;
53-
#pragma warning restore 168
54-
}
48+
protected void EnsureTransactionIsStarted() => Transaction.Require(QueryProvider.Session);
5549

5650
protected abstract int ExecuteInternal();
5751

0 commit comments

Comments
 (0)