openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 38ec3d30f47c84ca2eea0920e15ac2caa5ae1999
parent d6cecb041eabe07c230762a3005bae56ccb148c7
Author: dankert <devnull@localhost>
Date:   Wed,  2 Dec 2009 00:51:46 +0100

Ein 'rollback

Diffstat:
db/db.class.php | 17++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/db/db.class.php b/db/db.class.php @@ -65,7 +65,13 @@ class DB * * @var Object */ - var $client; + var $client; + + /** + * Schalter, ob eine Transaktion begonnen wurde. + * @var boolean + */ + var $transactionInProgress = false; /** @@ -397,7 +403,10 @@ class DB { if ( @$this->conf['transaction']) if ( method_exists($this->client,'start') ) + { + $this->transactionInProgress = true; $this->client->start(); + } } @@ -408,7 +417,8 @@ class DB { if ( @$this->conf['transaction']) if ( method_exists($this->client,'commit') ) - $this->client->commit(); + if ( $this->transactionInProgress ) + $this->client->commit(); } /** @@ -418,7 +428,8 @@ class DB { if ( @$this->conf['transaction']) if ( method_exists($this->client,'rollback') ) - $this->client->rollback(); + if ( $this->transactionInProgress ) + $this->client->rollback(); } }