In short.
Doctrine Batch Processing is an assistant skill for Symfony developers building imports, exports and backfills, but its example code is incomplete and comes without measured performance results. It explains how to limit retained ORM entities, choose between per-entity processing and bulk database writes, and monitor long-running jobs. The reference targets Doctrine ORM 3.x and DBAL 4.x, with notes for ORM 2.7+. Important gaps include examples that clear entities without showing a flush, an insert example that retains the input array, and no durable restart mechanism. Runtime correctness, memory savings and throughput are not assessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage comprises the complete selected folder content/skills/doctrine-batch-processing: SKILL.md and reference.md, plus the supplied repository-root LICENSE, all at revision 83522d88f20313c1db6f042a5a49c0e9e0b258b1. Other repository skills, build tooling, integrations and external documentation are outside this scope. No code or validation commands were executed. Installation compatibility, runtime correctness, performance, database portability and restart behavior remain unverified.
The overview
Identity
Doctrine Batch Processing belongs to dev-toolings/superpowers-symfony. The selected folder contains SKILL.md, which gives assistant instructions, and reference.md, which supplies PHP examples. The original folder is [https://github.com/dev-toolings/superpowers-symfony/tree/main/content/skills/doctrine-batch-processing].
It is an instruction resource an assistant can load. The selected files provide guidance and sample code; they do not supply a complete batch-processing application or an installable PHP library.
Assessment
The skill is useful as a focused checklist for reducing memory pressure in Doctrine jobs. Its strongest guidance connects implementation choices to consequences: clearing detaches entities, bulk writes bypass lifecycle behavior, and progress and memory should be measured.
The examples require careful adaptation. Some omit persistence steps or dependency wiring, and the supplied material contains no test results or benchmarks. It supports choosing an approach, while correctness and performance remain unverified.
Users
The intended users are Symfony developers working on imports, exports, backfills, large updates or deletions, and commands or workers that exhaust memory while processing entities.
Experienced developers can use it to review persistence and memory decisions. Beginners will need familiarity with Doctrine entities, database queries and dependency injection, plus help understanding detached objects and transaction boundaries.
Capabilities
The material covers toIterable() reads, flush-and-clear batches, pagination using an increasing ID, DQL UPDATE and DELETE, direct DBAL updates, batched inserts, memory logging, and Symfony console progress bars.
The skill asks an assistant to produce an explicit batch size, explain the write mechanism chosen, and obtain memory measurements on realistic data. Those are requested deliverables; the resource does not include measured results or automatically implement these features.
Using it
Requirements
Applying the examples requires a PHP project with the relevant Doctrine configuration, entity mappings and database connection. ORM examples use an EntityManager; direct SQL examples use a DBAL Connection. Console examples additionally depend on Symfony command infrastructure.
The reference states a target of ORM 3.x and DBAL 4.x and includes legacy notes for ORM 2.7+. Minimum PHP and Symfony versions are unspecified. SKILL.md declares reading, searching, editing and shell capabilities, but compatibility with a particular assistant host is unknown.
Mechanism
The central pattern processes query results incrementally. For writes, flush() sends pending ORM changes to the database, and clear() detaches managed entities so the ORM does not keep accumulating them. Objects needed after a clear must be fetched again.
The reference also shows fetching successive pages where id is greater than the last processed ID. For suitable mass changes, DQL or DBAL avoids loading individual entities. The documented tradeoff is that bulk operations bypass lifecycle behavior and can leave already-loaded objects stale.
Setup
Keep SKILL.md and reference.md together so the relative reference remains available. The selected files do not document a host-specific installation command or supported assistant integration.
Before adapting the PHP, supply the actual entities, services, queries and connection configuration. Establish the dataset size and memory budget, inspect lifecycle listeners, and choose a batch size. The reference advises configuring logging through the applicable configuration or middleware rather than relying on the removed setSQLLogger() API.
Example
For a hypothetical product backfill, the reference shows reading products with toIterable(), setting processedAt, and flushing and clearing after every 100 entities. A final flush and clear handles the remainder. The value 100 is an example batch size, with no evidence that it is optimal.
A separate Symfony command example selects products whose processedAt is null and displays progress. Turning this into an application command requires the omitted service wiring, count query and processing logic. These examples were not executed.
Assessment & evidence
Limitations
The simple iteration and memory-monitoring examples call clear() without showing a preceding flush(). Inspection suggests a risk of discarding pending changes when processing modifies entities. The separate flush-then-clear example is the relevant pattern for such writes.
The insert example accepts the entire input as an array and splits it with array_chunk(). It therefore does not demonstrate streaming the incoming dataset, and ORM batch size alone does not bound total memory use.
The reference warns that toIterable() cannot handle queries that fetch-join a collection-valued association. It requests resumability but supplies no durable checkpoint or retry design. The examples also leave job-level transaction guarantees and database portability unestablished.
Reasoning
The resource is most useful when a developer needs to decide how a particular job should read and write data. It gives concrete mechanisms and documents side effects that affect correctness.
The stated efficiency advantages of bulk operations are explanations in the reference, without comparative measurements. Treat batch sizes and performance expectations as hypotheses to validate against the actual schema, processing logic and workload.
Alternatives
Within the resource, ORM iteration supports per-entity processing, DQL expresses uniform updates or deletions, and DBAL provides direct SQL with an explicit transaction example. ID-based pagination offers another read strategy using a cursor held in memory.
The deciding questions are whether entity-level behavior is required, whether a change can be expressed as a bulk statement, and how progress must survive interruption. No external skill or library comparison is supplied, so relative superiority is unknown.
Evidence
The captured instruction file is [https://raw.githubusercontent.com/dev-toolings/superpowers-symfony/83522d88f20313c1db6f042a5a49c0e9e0b258b1/content/skills/doctrine-batch-processing/SKILL.md]. It establishes the intended uses, workflow, guardrails and requested outputs.
The captured companion is [https://raw.githubusercontent.com/dev-toolings/superpowers-symfony/83522d88f20313c1db6f042a5a49c0e9e0b258b1/content/skills/doctrine-batch-processing/reference.md]. It supplies the examples and compatibility assertions. The evidence contains no execution logs, test results, benchmarks or measured memory savings.
Access & freshness
Costs
Total cost is unknown. The supplied files give no assistant pricing, token usage, database resource estimate or implementation-effort estimate. They also provide no measurements from which operating costs or savings could be calculated.
Rights
The supplied repository-root MIT License permits use, modification, redistribution, sublicensing and sale, subject to retaining the copyright and permission notices in copies or substantial portions. It includes a warranty and liability disclaimer.
The notice is available at [https://raw.githubusercontent.com/dev-toolings/superpowers-symfony/83522d88f20313c1db6f042a5a49c0e9e0b258b1/LICENSE]. Neither selected file supplies a separate licence notice.
Freshness
The supplied snapshot was captured on 17 November 2026 at 04:35:40.648 UTC and identifies source revision 83522d88f20313c1db6f042a5a49c0e9e0b258b1. The original-file addresses pin both selected documents to that revision.
The selected files provide no release history or published skill version. Changes after the captured revision and compatibility beyond the stated ORM/DBAL targets are unknown.
Actions
Before using a pattern, inspect the job's listeners, associations and transaction requirements. Ensure writes are flushed before clearing, account for detached objects, and add durable progress and restart behavior where required.
Validate the adapted implementation on representative non-production data. Measure memory and progress, check final data correctness, and exercise interruption and restart. The reference suggests verbose command output, a run with a 128 MB PHP memory limit, and a Batch-filtered PHPUnit invocation; it supplies no results for these checks.
