> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AL0118 - Read-modify-write without transaction

> A method that reads data and then writes based on that data without a transaction is vulnerable to race conditions

Source: [AL0118ReadModifyWriteWithoutTransactionAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/AL0118ReadModifyWriteWithoutTransactionAnalyzer.cs)

## Description

A method that reads data and then writes based on that data without a transaction is vulnerable to race conditions. Another connection could modify the data between the read and write. Use BeginTransaction/BeginTransactionAsync to ensure isolation.

## Properties

* **Category**: Reliability
* **Severity**: Warning
* **Enabled by default**: True
* **Code fix available**: False

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0118.severity = warning
```
