make DB transaction safe
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 21 Mar 2008 15:30:22 +0000 (15:30 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 21 Mar 2008 15:30:22 +0000 (15:30 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@133 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

www/inc/db/db_mysql.php

index 5fb0904..edbfd82 100644 (file)
@@ -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)