---
title: "Bugfix: A deadlock no longer ends the import"
manual: "adsum by web-vision"
version: "main"
permalink: "https://docs.typo3.org/permalink/web-vision/adsum-monorepo:bugfix-1793003689@main"
source: "Changelog/1.0.0/Bugfix-1793003689-RetryABatchAfterALockConflict.rst"
rendered: "2026-11-07T02:01:32+00:00"
---

# Bugfix: A deadlock no longer ends the import {#bugfix-1793003689}

## Description {#description}

When a messenger worker handled attendance work for the employees an import was writing, the database could end the
import in a deadlock. The failed flush closed the entity manager, the run died with `The EntityManager is closed`
without a cause, and its record stayed `running`. A batch that runs into a lock conflict (a deadlock or a lock wait
timeout) is now rolled back and tried again on a fresh entity manager, up to three times with a growing pause. If it
still fails, the stage ends as failed with the issue `targetLocked` and the SQLSTATE of the database error, the
batches committed before stay, and the next run continues after them. A stage that fails for any other reason is also
marked as failed, with the cause shown. The installation guide says to stop the workers during the import.

## Impact {#impact}

An import survives a deadlock instead of aborting, and a failed stage never stays `running`.
