ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:failtrans

This is an old revision of the document!


failTrans

See Also

startTrans()
completeTrans()

Syntax
void failTrans()

Description

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

/*
 * Assume database connection
 */
$db->startTrans();
 
/*
 * some reason to rollback transaction
 */
 
$db->failTrans();
 
/*
* Lots more code inside the transaction scope
*/
 
$db->completeTrans(); //<---- at this point, the rollback is invoked
v5/reference/connection/failtrans.1452987439.txt.gz · Last modified: 2017/04/21 11:35 (external edit)