openrat-cms

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

commit 20261ecbdaef2a3ec89dbac155bdfd402d916d17
parent cfb08960c946844f416e9628d416f713f9e755d5
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 23 Oct 2018 00:54:47 +0200

Warnmeldung erzeugen, wenn Commit/Rollback ohne Transaktion erfolgen soll.

Diffstat:
modules/database/Database.class.php | 24++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/modules/database/Database.class.php b/modules/database/Database.class.php @@ -166,12 +166,14 @@ class Database */ public function commit() { - Logger::debug("Committing database transaction!"); - if ( $this->transactionInProgress ) - { - $this->client->commit(); + if ( $this->transactionInProgress ) + { + Logger::debug("Committing database transaction!"); + $this->client->commit(); $this->transactionInProgress = false; - } + } else { + Logger::warn("No Transaction in progress, ignoring commit request."); + } } @@ -182,12 +184,14 @@ class Database */ public function rollback() { - Logger::debug("Rolling back database transaction!"); - if ( $this->transactionInProgress ) - { - $this->client->rollback(); + if ( $this->transactionInProgress ) + { + Logger::debug("Rolling back database transaction!"); + $this->client->rollback(); $this->transactionInProgress = false; - } + } else { + Logger::warn("No Transaction in progress, ignoring rollback request."); + } } /**