lozitskiys/pdo-nested-transactions

There is no license information available for the latest version (2.0.1) of this package.

Support for nested transactions in PDO

2.0.1 2023-11-17 13:30 UTC

This package is auto-updated.

Last update: 2025-07-17 18:05:36 UTC


README

Example of nested transactions use:

$db = new PdoWithNT(/*credentials here*/);

try {
    $db->beginTransaction();

    // some logic here

    try {
        $db->beginTransaction();

        // some logic here

        $db->commit();
    } catch (Exception $e) {
        $db->rollBack();
        throw $e;
    }

    $db->commit();
} catch (Exception $e) {
    $db->rollBack();
    throw $e;
}

How to install

composer require lozitskiys/pdo-nested-transactions