From: Petr Skoda Date: Sun, 1 Nov 2009 10:07:58 +0000 (+0000) Subject: MDL-20699 fixed ws protocol servers to use new abort transactiosn function X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3086dd5964d2039be4f4d53ecebfefd48a43a8e0;p=moodle.git MDL-20699 fixed ws protocol servers to use new abort transactiosn function --- diff --git a/webservice/lib.php b/webservice/lib.php index ffd9717f47..be4f1c6901 100644 --- a/webservice/lib.php +++ b/webservice/lib.php @@ -485,17 +485,8 @@ class '.$classname.' { * @return void does not return */ public function exception_handler($ex) { - global $CFG, $DB, $SCRIPT; - // detect active db transactions, rollback and log as error - if ($DB->is_transaction_started()) { - error_log('Database transaction aborted by exception in ' . $CFG->dirroot . $SCRIPT); - try { - // note: transaction blocks should never change current $_SESSION - $DB->rollback_sql(); - } catch (Exception $ignored) { - } - } + abort_all_db_transactions(); // some hacks might need a cleanup hook $this->session_cleanup($ex); @@ -631,17 +622,8 @@ abstract class webservice_base_server extends webservice_server { * @return void does not return */ public function exception_handler($ex) { - global $CFG, $DB, $SCRIPT; - // detect active db transactions, rollback and log as error - if ($DB->is_transaction_started()) { - error_log('Database transaction aborted by exception in ' . $CFG->dirroot . $SCRIPT); - try { - // note: transaction blocks should never change current $_SESSION - $DB->rollback_sql(); - } catch (Exception $ignored) { - } - } + abort_all_db_transactions(); // some hacks might need a cleanup hook $this->session_cleanup($ex);