Skip to content

Commit 377a28c

Browse files
committed
Minor changes
- removed commented code - used ordinal comparison for strings - some formatting applied
1 parent b873d6e commit 377a28c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Extensions/Xtensive.Orm.Reprocessing/ExecuteActionStrategy.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
using System;
1+
using System;
22
using System.Collections.Concurrent;
33
using System.Transactions;
44
using Xtensive.Core;
5-
using Xtensive.Orm.Configuration;
65
using SystemTransaction = System.Transactions.Transaction;
76

87
namespace Xtensive.Orm.Reprocessing
@@ -56,21 +55,23 @@ public virtual T Execute<T>(ExecutionContext<T> context)
5655
try {
5756
T result;
5857
var disposeSession = false;
59-
//SessionScope sessionScope = null;
6058
try {
6159
try {
6260
var isolationLevel = context.IsolationLevel;
6361
var currentTransaction = SystemTransaction.Current;
64-
if (isolationLevel == IsolationLevel.Unspecified && currentTransaction != null)
62+
if (isolationLevel == IsolationLevel.Unspecified && currentTransaction != null) {
6563
isolationLevel = currentTransaction.IsolationLevel;
64+
}
65+
6666
session = context.ExternalSession;
6767
if (session == null) {
6868
session = context.Domain.OpenSession();
6969
disposeSession = true;
70-
//sessionScope = session.Activate();
7170
}
72-
if (currentTransaction != null && session.Transaction != null)
71+
if (currentTransaction != null && session.Transaction != null) {
7372
session.EnsureTransactionIsStarted();
73+
}
74+
7475
tran = (currentTransaction != null && currentTransaction.TransactionInformation.DistributedIdentifier != Guid.Empty) ||
7576
(session.Transaction != null && session.Transaction.IsDisconnected)
7677
? session.OpenTransaction(isolationLevel)
@@ -85,7 +86,7 @@ public virtual T Execute<T>(ExecutionContext<T> context)
8586
}
8687
catch (StorageException e) {
8788
if (e.InnerException == null || !(e.InnerException is InvalidOperationException) ||
88-
e.InnerException.Source != "System.Data") {
89+
!e.InnerException.Source.Equals("System.Data", StringComparison.Ordinal)) {
8990
throw;
9091
}
9192

0 commit comments

Comments
 (0)