ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:transoff

transOff

Syntax
int ADOconnection::transOff

Description

Setting the value of $db→transOff temporarily disables transaction startup.

For granular transaction handling:

  • The value is automatically set to 1 after the first beginTrans() statement, which prevents transaction scopes being nested.
  • * Causes ADOdb to ignore any beginTrans() requests, if a transaction has not been started.

For smart transaction handling, Setting transOff to 1:

  • Causes ADOdb to ignore any startTrans() requests, if a transaction has not been started.
  • Acts like failTrans() if a transaction has been started.

Usage

$db->startTrans();
 
$db->execute('some insert statement...');
 
/*
* Set the transOff variable
*/
$db->transOff = 1;
 
/*
* Transaction is rolled back, even though no errors occured
*/
$db->completeTrans()
v5/reference/connection/transoff.txt · Last modified: 2016/04/14 15:45 by mnewnham