]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
rpc: switch to PDO
[tt-rss.git] / include / functions.php
index 4154d8d5e82293bf5d6cac94a40237eb0f1a32d5..f09d72cd079607803da01d0cd31387562fb887b2 100644 (file)
                if (get_schema_version() < 63) $profile_qpart = "";
 
         $pdo = DB::pdo();
+        $in_nested_tr = false;
 
-        $pdo->beginTransaction();
+        try {
+                       $pdo->beginTransaction();
+               } catch (Exception $e) {
+               $in_nested_tr = true;
+               }
 
                $sth = $pdo->query("SELECT pref_name,def_value FROM ttrss_prefs");
 
                        }
                }
 
-               $pdo->commit();
+               if (!$in_nested_tr) $pdo->commit();
 
        }