
doctrine-transactions
Handle Doctrine transactions (ORM 3 wrapInTransaction), optimistic/pessimistic locking, flush strategies, and transaction boundaries
- Installs
- 95
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/dev-toolings/superpowers-symfony --skill doctrine-transactions- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads doctrine-transactions automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Doctrine Transactions (Symfony)
Use when
- Several writes must succeed or fail together.
- Two users or workers can edit the same row concurrently.
- Deciding where to flush and who owns the transaction boundary.
- Recovering after a failed flush, a constraint violation, or a lost connection.
Default workflow
- Place the transaction boundary in the service layer, not in the controller.
- Group related changes and flush once, inside
wrapInTransaction(). - Pick the concurrency strategy:
#[ORM\Version]optimistic locking for edits,PESSIMISTIC_WRITEfor short critical sections. - Handle
OptimisticLockExceptionand constraint violations explicitly. - After a rollback, clear the EntityManager and re-fetch what you still need.
Guardrails
- On ORM 3,
EntityManager::transactional()is gone: usewrapInTransaction(). - Outside an explicit transaction each flush commits on its own, so avoid several flushes per operation.
- Keep transactions and pessimistic locks short; no HTTP calls or mail inside.
- Do not reuse entities from a failed unit of work.
Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.
Output contract
- Transaction boundaries with a single flush per operation.
- The locking strategy chosen per entity, and how conflicts reach the user.
- Rollback handling and the state of the EntityManager after it.
References
reference.md
FAQ
What does the doctrine-transactions skill do?
Handle Doctrine transactions (ORM 3 wrapInTransaction), optimistic/pessimistic locking, flush strategies, and transaction boundaries
How do I install doctrine-transactions?
Run npx skills add https://github.com/dev-toolings/superpowers-symfony --skill doctrine-transactions in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/doctrine-transactions/ (personal) or .claude/skills/doctrine-transactions/ (project).
Which AI agents can use doctrine-transactions?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is doctrine-transactions safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains doctrine-transactions?
It is published by dev-toolings in dev-toolings/superpowers-symfony. It has 95 recorded installs.
More from dev-toolings/superpowers-symfony
symfony:interfaces-and-autowiring
dev-toolings/superpowers-symfony
Master Symfony Dependency Injection with autowiring,
symfony:controller-cleanup
dev-toolings/superpowers-symfony
Refactor fat controllers into lean ones by extracting business logic to services, handlers, and invokable commands
symfony:doctrine-migrations
dev-toolings/superpowers-symfony
Create and manage Doctrine migrations (lib 4.x) for schema versioning; handle dependencies, rollbacks, and production deployment
symfony:tdd-with-phpunit
dev-toolings/superpowers-symfony
Apply RED-GREEN-REFACTOR with PHPUnit 10/11 for Symfony; KernelTestCase/WebTestCase, attributes ([Test]/[DataProvider]), Foundry
symfony:quality-checks
dev-toolings/superpowers-symfony
Run code quality tools: PHP-CS-Fixer for style, PHPStan for static analysis, and type safety checks
symfony:doctrine-relations
dev-toolings/superpowers-symfony
Define Doctrine entity relationships (OneToMany, ManyToMany, ManyToOne); configure cascade, orphan removal, multiple entity managers; prevent N+1 queries
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.