From fbe7cb0a4802519c405c86394a8426791d48fe26 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 1 Dec 2017 23:49:14 +0300 Subject: rpc: switch to PDO --- include/functions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 4154d8d5e..f09d72cd0 100644 --- a/include/functions.php +++ b/include/functions.php @@ -592,8 +592,13 @@ 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"); @@ -630,7 +635,7 @@ } } - $pdo->commit(); + if (!$in_nested_tr) $pdo->commit(); } -- cgit v1.2.3-54-g00ecf