|
1 | | -// Copyright (C) 2003-2010 Xtensive LLC. |
2 | | -// All rights reserved. |
3 | | -// For conditions of distribution and use, see license. |
| 1 | +// Copyright (C) 2009-2021 Xtensive LLC. |
| 2 | +// This code is distributed under MIT license terms. |
| 3 | +// See the License.txt file in the project root for more information. |
4 | 4 | // Created by: Denis Krjuchkov |
5 | 5 | // Created: 2009.11.26 |
6 | 6 |
|
@@ -159,25 +159,30 @@ public void RollbackNestedTransactionWithActiveEnumeratorTest() |
159 | 159 | public void RollbackNestedTransactionWithActiveEnumeratorAndThenCompleteOutermostTest() |
160 | 160 | { |
161 | 161 | var session = Session.Demand(); |
162 | | - using (var outerTx = session.OpenTransaction()) { |
163 | | - _ = new Hexagon(); |
164 | | - _ = new Hexagon(); |
165 | | - _ = new Hexagon(); |
| 162 | + var outerTx = session.OpenTransaction(); |
| 163 | + _ = new Hexagon(); |
| 164 | + _ = new Hexagon(); |
| 165 | + _ = new Hexagon(); |
166 | 166 |
|
167 | | - IEnumerator<int> enumerator = null; |
168 | | - var innerTx = session.OpenTransaction(TransactionOpenMode.New); |
| 167 | + IEnumerator<int> enumerator = null; |
| 168 | + var innerTx = session.OpenTransaction(TransactionOpenMode.New); |
169 | 169 |
|
170 | | - enumerator = session.Query.All<Hexagon>() |
171 | | - .Select(item => item.Id).AsEnumerable().GetEnumerator(); |
172 | | - _ = enumerator.MoveNext(); |
| 170 | + enumerator = session.Query.All<Hexagon>() |
| 171 | + .Select(item => item.Id).AsEnumerable().GetEnumerator(); |
| 172 | + _ = enumerator.MoveNext(); |
173 | 173 |
|
174 | | - if (storageProviderInfo.CheckProviderIs(StorageProvider.SqlServer)) { |
175 | | - _ = Assert.Throws<StorageException>(() => innerTx.Dispose()); |
176 | | - } |
177 | | - else { |
178 | | - Assert.DoesNotThrow(() => innerTx.Dispose()); |
179 | | - } |
180 | | - outerTx.Complete(); |
| 174 | + if (storageProviderInfo.CheckProviderIs(StorageProvider.SqlServer)) { |
| 175 | + _ = Assert.Throws<StorageException>(() => innerTx.Dispose()); |
| 176 | + } |
| 177 | + else { |
| 178 | + Assert.DoesNotThrow(() => innerTx.Dispose()); |
| 179 | + } |
| 180 | + outerTx.Complete(); |
| 181 | + if (storageProviderInfo.CheckProviderIs(StorageProvider.SqlServer)) { |
| 182 | + _ = Assert.Throws<StorageException>(() => outerTx.Dispose()); |
| 183 | + } |
| 184 | + else { |
| 185 | + Assert.DoesNotThrow(() => outerTx.Dispose()); |
181 | 186 | } |
182 | 187 | } |
183 | 188 |
|
|
0 commit comments