Skip to content
Search
DSL · Doctrine

to_dbal_transaction

Definition

/**
 * Execute multiple loaders within database transactions.
 * Each batch of rows is loaded in its own transaction; rows a wrapped Transformation delivers when
 * the loader is closed (blocking operations drain there) are committed in one final transaction.
 * If any loader fails, the open transaction is rolled back.
 * Atomicity requires every wrapped loader to use the same connection as the wrapper: pass one live
 * Connection to both - a wrapped loader built from array params opens its own connection and
 * escapes the transaction.
 *
 * @param array<string, mixed>|Connection $connection
 * @param Loader ...$loaders - Loaders to execute within the transaction
 *
 * @throws InvalidArgumentException
 */
to_dbal_transaction(Connection|array $connection, Loader $loaders) : TransactionalDbalLoader

Contributors

Built in the open.

Join us on GitHub
scroll back to top