22 return $this->wrapperObject->nestable ();
31 if ($this->transactionLevel == 0 || ! $this->
nestable ()) {
32 $ret = $this->wrapperObject->beginTransaction ();
33 Logger::info (
'Transactions',
'Start transaction',
'beginTransaction' );
34 $this->transactionLevel ++;
37 $this->wrapperObject->savePoint ( $this->transactionLevel );
38 Logger::info (
'Transactions',
'Savepoint level',
'beginTransaction', $this->transactionLevel );
39 $this->transactionLevel ++;
49 $this->transactionLevel --;
50 if ($this->transactionLevel == 0 || ! $this->
nestable ()) {
51 Logger::info (
'Transactions',
'Commit transaction',
'commit' );
52 return $this->wrapperObject->commit ();
54 $this->wrapperObject->releasePoint ( $this->transactionLevel );
55 Logger::info (
'Transactions',
'Release savepoint level',
'commit', $this->transactionLevel );
88 $this->transactionLevel --;
89 if ($this->transactionLevel == 0 || ! $this->
nestable ()) {
90 Logger::info (
'Transactions',
'Rollback transaction',
'rollBack' );
91 return $this->wrapperObject->rollBack ();
93 $this->wrapperObject->rollbackPoint ( $this->transactionLevel );
94 Logger::info (
'Transactions',
'Rollback to savepoint level',
'rollBack', $this->transactionLevel );
127 return $this->wrapperObject->inTransaction ();
141 $ret = call_user_func_array ( $callback, $parameters );
142 }
catch ( \Exception $e ) {
143 $this->wrapperObject->rollBack ();
149 throw new DBException (
'Transaction was not committed.' );
157 throw new DBException (
'Transaction was not started.' );
167 return $this->wrapperObject->setIsolationLevel($isolationLevel);
setIsolationLevel($isolationLevel)
Sets the isolation level for transactions.
rollBackToLevel($transactionLevel)
Rolls back nested transactions up to level $transactionLevel.
commitAll()
Commits all nested transactions (up to level 0)
commitToLevel($transactionLevel)
Commits nested transactions up to level $transactionLevel.
rollBackAll()
Rolls back all nested transactions (up to level 0)
inTransaction()
Checks if inside a transaction.
callInTransaction($callback,... $parameters)
Call a callback with an array of parameters in a transaction.
rollBack()
Rolls back a transaction.
beginTransaction()
Initiates a transaction.
commit()
Commits a transaction.
Abstract class for logging Ubiquity\log$Logger This class is part of Ubiquity.