diff options
author | Andrew Dolgov <[email protected]> | 2017-12-01 23:49:14 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-12-01 23:49:14 +0300 |
commit | fbe7cb0a4802519c405c86394a8426791d48fe26 (patch) | |
tree | da9c3b89828b8eecb0a273acaac2c973dbe814ee /include/functions.php | |
parent | 9652fa6b6687b0aa2ac55cd735cdf43f32398faa (diff) |
rpc: switch to PDO
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 9 |
1 files changed, 7 insertions, 2 deletions
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(); } |