2017 © Pedro Peláez
 

library transaction-nesting

Allows you to nest transactions with dibi database connection.

image

lightools/transaction-nesting

Allows you to nest transactions with dibi database connection.

  • Tuesday, April 12, 2016
  • by janedbal
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,069 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 36 % Grown

The README.md

Introduction

This library allows you to nest database transactions over dibi connection., (*1)

Installation

$ composer require lightools/transaction-nesting

Simple usage

TransactionManager will begin/commit/rollback database transaction only if there is no other transaction running. So if you try to start new transaction when some transaction is active, it will not fail with error There is already an active transaction. This means you can nest transactions safely and TransactionManager will make sure that only the outer transaction will be performed., (*2)

$dibi = new Dibi\Connection($config);
$manager = new Lightools\TransactionNesting\TransactionManager($dibi);

$manager->transactional(function () {
    // your logic
});

Of course, this will break if you perform some query causing implicit commit (for example ALTER TABLE on MySQL)., (*3)

How to run tests

$ vendor/bin/tester -c tests/php.ini -d extension_dir=ext tests

The Versions

12/04 2016

dev-master

9999999-dev

Allows you to nest transactions with dibi database connection.

  Sources   Download

MIT

The Requires

 

The Development Requires

12/04 2016

v1.0.1

1.0.1.0

Allows you to nest transactions with dibi database connection.

  Sources   Download

MIT

The Requires

 

The Development Requires

22/03 2016

v1.0.0

1.0.0.0

Allows you to nest transactions with dibi database connection.

  Sources   Download

MIT

The Requires

 

The Development Requires