CodeSampleX

Ejemplo

doctrine/dbal 4.4.4: Handle DBAL 4 transaction savepoint isolation, CompositeExpression immutability, and Result fetch indexing differences

Muestra verificada para composer doctrine/dbal 4.4.4: Handle DBAL 4 transaction savepoint isolation, CompositeExpression immutability, and Result fetch…

sha256:92cf176cb7b66c578f8df42d44789e686a21fa578ec7cba999e0d8082036a74e

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
2
Entorno declarado php linux x64 php php composer

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
php 8 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-16
php 8 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-18

Caso

HOW
Objetivo
Handle DBAL 4 transaction savepoint isolation, CompositeExpression immutability, and Result fetch indexing differences
Paquetes
Símbolos
  • Doctrine\DBAL\Connection::beginTransaction
  • Doctrine\DBAL\Connection::rollBack
  • Doctrine\DBAL\Connection::commit
  • Doctrine\DBAL\Connection::setAutoCommit
  • Doctrine\DBAL\Connection::setNestTransactionsWithSavepoints
  • Doctrine\DBAL\Query\Expression\CompositeExpression::and
  • Doctrine\DBAL\Query\Expression\CompositeExpression::with
  • Doctrine\DBAL\Result::fetchAllAssociativeIndexed
  • Doctrine\DBAL\Result::fetchAllKeyValue
Entorno
php
Creado
2026-08-16T08:34:43Z

Contrato

  1. In DBAL 4 nested transactions always create SQL savepoints, so an inner rollBack() reverts only to the savepoint and does not mark the outer transaction rollback-only.
  2. Attempting to disable savepoints via setNestTransactionsWithSavepoints(false) throws InvalidArgumentException because nesting without savepoints was removed in DBAL 4.
  3. With autoCommit=false, executing queries starts a Level 1 transaction, a manual beginTransaction() increments to Level 2 (savepoint), and commit() immediately restarts Level 1 so the nesting level never drops to 0.
  4. Calling commit() with autoCommit=true and no active transaction throws Doctrine\DBAL\Exception\NoActiveTransaction.
  5. CompositeExpression is immutable: calling with() returns a new clone without mutating the caller in place, meaning unassigned calls silently drop filter conditions.
  6. Result::fetchAllAssociativeIndexed() keys the result by the first column and shifts that column out of the row dictionary values.
  7. Result::fetchAllKeyValue() requires at least two columns and silently ignores any columns beyond the first two.

Archivos

  • NOTES.md
  • composer.json
  • composer.lock
  • csx.json
  • phpunit.xml
  • tests/ContractTest.php

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

csx-seed