From ca4e9b296bac9c77c1a8f09143128a3b51013ea9 Mon Sep 17 00:00:00 2001 From: konrad Date: Fri, 21 Mar 2008 15:30:22 +0000 Subject: [PATCH] make DB transaction safe git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@133 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- www/inc/db/db_mysql.php | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/www/inc/db/db_mysql.php b/www/inc/db/db_mysql.php index 5fb0904..edbfd82 100644 --- a/www/inc/db/db_mysql.php +++ b/www/inc/db/db_mysql.php @@ -55,7 +55,10 @@ class MysqlEngine extends DbEngine die("Unable to connect to database system. Giving up."); //select Unicode; TODO: fix it to be configurable if(mysqli_query($this->dbhdl,"SET NAMES 'utf8'")===false) - die("cannot set character set to utf-8"); + die("Cannot set DB character set to utf-8, aborting."); + //make sure the DB is transaction safe + if(mysqli_query($this->dbhdl,"SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE")===false) + die("Cannot make this database transaction safe, aborting"); } public function haveTable($tnm) -- 1.7.2.5