dev-toolings/superpowers-symfony108 installs
doctrine-transactions
Handle Doctrine transactions (ORM 3 wrapInTransaction), optimistic/pessimistic locking, flush strategies, and transaction boundaries
How do I install this agent skill?
npx skills add https://github.com/dev-toolings/superpowers-symfony --skill doctrine-transactionsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides documentation and code examples for managing database transactions and concurrency locking using the Doctrine ORM in PHP/Symfony applications. It contains no malicious code, remote downloads, or dangerous commands.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
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
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/dev-toolings/superpowers-symfony/doctrine-transactions">View doctrine-transactions on skillZs</a>