ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:failtrans

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revisionBoth sides next revision
reference:failtrans [2015/08/08 19:46] – created mnewnhamreference:failtrans [2015/12/28 21:50] mnewnham
Line 3: Line 3:
 <WRAP right box> <WRAP right box>
 == See Also == == See Also ==
-[[reference:starttrans|startTrans()]] +[[reference:starttrans|startTrans()]]\\ 
- +[[reference:completetrans|completeTrans()]]\\
-[[reference:completetrans|completeTrans()]]+
  
 == Syntax == == Syntax ==
Line 11: Line 10:
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-The function ''failTrans()'' forces a roll back of a **smart transaction**. The rollback actually occurs at the point where ''completeTrans()'' is invoked. +The method ''failTrans()'' forces a roll back of a **smart transaction**. The method can be called anywhere inside a transaction scope, but the rollback actually occurs at the point where ''completeTrans()'' is invoked. 
- +----------------------------
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
Line 25: Line 24:
  
 $db->failTrans(); $db->failTrans();
 +
 +/*
 +* Lots more code inside the transaction scope
 +*/
 +
 +$db->completeTrans(); //<---- at this point, the rollback is invoked
 +
 </code> </code>
    
v5/reference/connection/failtrans.txt · Last modified: 2016/01/17 00:37 by mnewnham