====== transOff ======
~~NOTOC~~
== 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 [[v5:reference:connection:begintrans|beginTrans()]] statement, which prevents transaction scopes being nested.
* * Causes ADOdb to ignore any [[v5:reference:connection:begintrans|beginTrans()]] requests, if a transaction has not been started.
For **//smart//** transaction handling, Setting transOff to 1:
* Causes ADOdb to ignore any [[v5:reference:connection:starttrans|startTrans()]] requests, if a transaction has not been started.
* Acts like [[v5:reference:connection:failtrans|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()