UNB Components Code Reference

UnbDatabase::StartTransaction method

Starts a new transaction.

public function UnbDatabase::StartTransaction ($lock = false);

Parameters

lock  –  optional, default: false

(bool) Lock the entire database. This option is only regarded for database system that don't support table or row-level locking, like SQLite. It can only be used when no other transaction is currently started (i.e. the transaction level counter is 0).

Return value

true, if successful, false otherwise.

Remarks

If a transaction is already started, only the counter is increased by 1, but no real nested transaction is started.

Exceptions thrown

BadMethodCallException 

When trying to acquire a lock for the transaction if a transaction has already started.

Member of class: UnbDatabase

Implementation file: database.class.php, line 444

© 2011 Yves Goergen. UNB Components Homepage. Reference generated on 2011-02-22.