Documentation

Manager extends AbstractManager
in package

Nested transaction manager for use in AdapaterInterface implementations

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

author

Martok martok@martoks-place.de

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
6.5.0

Table of Contents

Constants

TS_NONE  = 0
TS_OPEN  = 1
TS_ROLLED_BACK  = -1

Properties

$savepointName  : int
$savepoints  : array<string|int, string>
Names of active savepoints. Count is always one less than $transactionDepth.
$transactionDepth  : int
Transaction depth
$transactionState  : int
Transaction state flag
$useSavepoints  : bool
Use savepoints or simulated nested transactions (SNTs)

Methods

__construct()  : mixed
Constructor
enter()  : bool
Enter a new transaction or increase nesting level
getTransactionDepth()  : int
Get transaction depth
isTransaction()  : bool
Check if adapter is in the middle of an open transaction
leave()  : bool
Leave a transaction or reduce nesting level

Constants

TS_ROLLED_BACK

private mixed TS_ROLLED_BACK = -1

Properties

$savepointName

private int $savepointName = 0

$savepoints

Names of active savepoints. Count is always one less than $transactionDepth.

private array<string|int, string> $savepoints = []

$transactionDepth

Transaction depth

private int $transactionDepth = 0

$transactionState

Transaction state flag

private int $transactionState = 0

$useSavepoints

Use savepoints or simulated nested transactions (SNTs)

private bool $useSavepoints

Methods

__construct()

Constructor

public __construct([bool $useSavepoints = true ]) : mixed

Instantiate the transaction manager object

Parameters
$useSavepoints : bool = true

Enable the use of savepoints by default

enter()

Enter a new transaction or increase nesting level

public enter([callable|null $beginFunc = null ][, callable|null $savepointFunc = null ]) : bool
Parameters
$beginFunc : callable|null = null

Called when a new top-level transaction must be started

$savepointFunc : callable|null = null

Called when a named savepoint is created

Return values
bool

getTransactionDepth()

Get transaction depth

public getTransactionDepth() : int
Return values
int

isTransaction()

Check if adapter is in the middle of an open transaction

public isTransaction() : bool
Return values
bool

leave()

Leave a transaction or reduce nesting level

public leave(bool $doCommit[, callable|null $commitFunc = null ][, callable|null $rollbackFunc = null ][, callable|null $savepointReleaseFunc = null ][, callable|null $savepointRollbackFunc = null ]) : bool
Parameters
$doCommit : bool

If true, perform a commit. Rollback otherwise.

$commitFunc : callable|null = null

Called when a top-level commit must be performed

$rollbackFunc : callable|null = null

Called when a top-level rollback must be performed

$savepointReleaseFunc : callable|null = null

Called when a savepoint is released (like commit)

$savepointRollbackFunc : callable|null = null

Called when the transaction is rolled back to a savepoint

Return values
bool

        
On this page

Search results