add DB::transactionDepth() for checking how many transactions are active

when not using nested transactions, will return 1 or 0
This commit is contained in:
Sergey Tsalkov
2012-09-18 21:08:28 -07:00
parent 9a41bf34a1
commit ed9c29fe49
2 changed files with 4 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ class TransactionTest_55 extends SimpleTest {
$depth = DB::startTransaction();
$this->assert($depth === 3);
$this->assert(DB::transactionDepth() === 3);
DB::query("UPDATE accounts SET age=%i WHERE username=%s", 500, 'Abe');
$depth = DB::commit();