From: konrad Date: Fri, 21 Mar 2008 15:30:22 +0000 (+0000) Subject: make DB transaction safe X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=ca4e9b296bac9c77c1a8f09143128a3b51013ea9;p=web%2Fkonrad%2Fsmoke.git make DB transaction safe git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@133 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- 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)