mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-20699 fixed ws protocol servers to use new abort transactiosn function
This commit is contained in:
parent
1387fcdd58
commit
3086dd5964
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user