ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:transoff

This is an old revision of the document!


transOff

<WRAP right box}

Syntax
int ADOconnection::transOff

</WRAP>

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.

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.1460641400.txt.gz · Last modified: 2017/04/21 11:32 (external edit)