CodeSampleX

Exemplo

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

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

sha256:92cf176cb7b66c578f8df42d44789e686a21fa578ec7cba999e0d8082036a74e

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
2
Chaves de assinatura que o compilaram
2
Ambiente declarado php linux x64 php php composer

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
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
Pacotes
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
Ambiente
php
Criado
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.

Arquivos

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

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

csx-seed