@@ -170,6 +170,7 @@ from o in c.Orders.Where(x => true).WithLock(LockMode.Upgrade)
170
170
[ Test ]
171
171
public async Task CanSetLockOnLinqPagingQueryAsync ( )
172
172
{
173
+ Assume . That ( TestDialect . SupportsSelectForUpdateInSubQueries , Is . True , "Dialect does not support locking in subqueries" ) ;
173
174
using ( session . BeginTransaction ( ) )
174
175
{
175
176
var result = await ( ( from e in db . Customers
@@ -178,14 +179,14 @@ public async Task CanSetLockOnLinqPagingQueryAsync()
178
179
Assert . That ( result , Has . Count . EqualTo ( 5 ) ) ;
179
180
Assert . That ( session . GetCurrentLockMode ( result [ 0 ] ) , Is . EqualTo ( LockMode . Upgrade ) ) ;
180
181
181
- if ( TestDialect . SupportsSelectForUpdateInSubQueries )
182
- await ( AssertSeparateTransactionIsLockedOutAsync ( result [ 0 ] . CustomerId ) ) ;
182
+ await ( AssertSeparateTransactionIsLockedOutAsync ( result [ 0 ] . CustomerId ) ) ;
183
183
}
184
184
}
185
185
186
186
[ Test ]
187
187
public async Task CanLockBeforeSkipOnLinqOrderedPageQueryAsync ( )
188
188
{
189
+ Assume . That ( TestDialect . SupportsSelectForUpdateInSubQueries , Is . True , "Dialect does not support locking in subqueries" ) ;
189
190
using ( session . BeginTransaction ( ) )
190
191
{
191
192
var result = await ( ( from e in db . Customers
@@ -196,8 +197,7 @@ orderby e.CompanyName
196
197
Assert . That ( result , Has . Count . EqualTo ( 5 ) ) ;
197
198
Assert . That ( session . GetCurrentLockMode ( result [ 0 ] ) , Is . EqualTo ( LockMode . Upgrade ) ) ;
198
199
199
- if ( TestDialect . SupportsSelectForUpdateInSubQueries )
200
- await ( AssertSeparateTransactionIsLockedOutAsync ( result [ 0 ] . CustomerId ) ) ;
200
+ await ( AssertSeparateTransactionIsLockedOutAsync ( result [ 0 ] . CustomerId ) ) ;
201
201
}
202
202
}
203
203
0 commit comments