Skip to content

lozitskiys/pdo-nested-transactions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Info

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

About

Support for nested transactions in PDO

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages