<turbo-stream action="update" target="wiki_card"><template>

<h1>Transaction (Process ID) was deadlocked on resources</h1>
<div class="trix-content"><p><strong>Scenario</strong>: Occurs when two or more processes block each other while waiting for resources, leading to a deadlock.<br><br><strong>Error Message</strong>:<code> E2059 - ECE_ForwardedSQLError: Native Error Code: 1205 SQL State: 40001 [Microsoft][ODBC SQL Server Driver][SQL Server]Transaction (Process ID 120) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.</code></p><div><strong>Cause</strong>: Poor query design or simultaneous updates on the same data.<br><br></div><div><strong>Resolution</strong>:<br><br></div><ul><li>Optimize queries to minimize lock contention (e.g., using WITH (NOLOCK) for reads).</li><li>Break large transactions into smaller, less-intensive ones.</li><li>Implement retry logic for deadlock errors.</li></ul></div>
</template></turbo-stream>

