# ExclusiveLockTransactionTestRunnerxUnit Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.xunit/orleans.transactions.testkit.xunit.exclusivelocktransactiontestrunnerxunit/)

## ConcurrentReadThenWriteWithExclusiveLock_NoLockException(string) {#concurrentreadthenwritewithexclusivelock-nolockexception-string-122139b9}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.xunit/orleans.transactions.testkit.xunit.exclusivelocktransactiontestrunnerxunit/methods/concurrentreadthenwritewithexclusivelock-nolockexception-string-122139b9/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Transactions.TestKit.xUnit/ExclusiveLockTransactionTestRunner.cs#L24)

```csharp
public override Task ConcurrentReadThenWriteWithExclusiveLock_NoLockException(string grainStates)
```

Verifies that using [UseExclusiveLock] on the read method prevents lock upgrade exceptions when concurrent transactions perform Read-then-Write on the same grain.

### Parameters

- `grainStates` (`string`)

## ConcurrentReadThenWriteWithoutExclusiveLock_ThrowsLockException(string) {#concurrentreadthenwritewithoutexclusivelock-throwslockexception-string-660004a1}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.xunit/orleans.transactions.testkit.xunit.exclusivelocktransactiontestrunnerxunit/methods/concurrentreadthenwritewithoutexclusivelock-throwslockexception-string-660004a1/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Transactions.TestKit.xUnit/ExclusiveLockTransactionTestRunner.cs#L17)

```csharp
public override Task ConcurrentReadThenWriteWithoutExclusiveLock_ThrowsLockException(string grainStates)
```

Verifies that concurrent Read-then-Write transactions on the same grain cause OrleansTransactionLockUpgradeException or OrleansBrokenTransactionLockException when no exclusive lock is used. Scenario (LockUpgradeException): TX1: PerformRead → shared lock acquired TX2: PerformRead → shared lock acquired (same group) TX1: PerformUpdate → lock upgrade fails Scenario (BrokenTransactionLockException): TX1: PerformRead → shared lock acquired TX2: PerformRead → shared lock acquired (same group) TX2: PerformUpdate → upgraded, TX1 rolled back TX1: PerformUpdate → broken lock detected

### Parameters

- `grainStates` (`string`)
