Class \Prado\Data\TDbTransaction
TDbTransaction class.
TDbTransaction represents a DB transaction. It is usually created by calling TDbConnection::beginTransaction.
The following code is a common scenario of using transactions:
try
{
$transaction=$connection->beginTransaction();
$connection->createCommand($sql1)->execute();
$connection->createCommand($sql2)->execute();
//.... other SQL executions
$transaction->commit();
}
catch(Exception $e)
{
$transaction->rollBack();
}
Class hierarchy
Author: Qiang Xue <qiang.xue@gmail.com>Since: 3.0
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
protected
|
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |