1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-13 01:24:06 +02:00

- implemented savepoints support

This commit is contained in:
David Grudl
2008-11-17 16:17:16 +00:00
parent 2f690b63f9
commit fb2621eb04
12 changed files with 107 additions and 59 deletions

View File

@@ -165,10 +165,11 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Begins a transaction (if supported).
* @param string optinal savepoint name
* @return void
* @throws DibiDriverException
*/
public function begin()
public function begin($savepoint = NULL)
{
if (!$this->connection->beginTransaction()) {
$err = $this->connection->errorInfo();
@@ -180,10 +181,11 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Commits statements in a transaction.
* @param string optinal savepoint name
* @return void
* @throws DibiDriverException
*/
public function commit()
public function commit($savepoint = NULL)
{
if (!$this->connection->commit()) {
$err = $this->connection->errorInfo();
@@ -195,10 +197,11 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
/**
* Rollback changes in a transaction.
* @param string optinal savepoint name
* @return void
* @throws DibiDriverException
*/
public function rollback()
public function rollback($savepoint = NULL)
{
if (!$this->connection->rollBack()) {
$err = $this->connection->errorInfo();