Set Database::throwExceptions back in calculate statistics funcs

This commit is contained in:
Dmitriy Simushev 2013-05-07 12:14:59 +00:00
parent d3b254fc82
commit 663c9119e6

View File

@ -45,7 +45,7 @@ function setup_statistics_tabs($active)
function calculate_thread_statistics() { function calculate_thread_statistics() {
// Prepare database // Prepare database
$db = Database::getInstance(); $db = Database::getInstance();
$db->throwExeptions(true); $db_throw_exceptions = $db->throwExeptions(true);
try { try {
// Start transaction // Start transaction
@ -111,11 +111,17 @@ function calculate_thread_statistics() {
E_USER_WARNING E_USER_WARNING
); );
$db->query('ROLLBACK'); $db->query('ROLLBACK');
// Set throw exceptions back
$db->throwExeptions($db_throw_exceptions);
return; return;
} }
// Commit transaction // Commit transaction
$db->query('COMMIT'); $db->query('COMMIT');
// Set throw exceptions back
$db->throwExeptions($db_throw_exceptions);
} }
/** /**
@ -124,7 +130,7 @@ function calculate_thread_statistics() {
function calculate_operator_statistics() { function calculate_operator_statistics() {
// Prepare database // Prepare database
$db = Database::getInstance(); $db = Database::getInstance();
$db->throwExeptions(true); $db_throw_exceptions = $db->throwExeptions(true);
try { try {
// Start transaction // Start transaction
@ -172,11 +178,17 @@ function calculate_operator_statistics() {
E_USER_WARNING E_USER_WARNING
); );
$db->query('ROLLBACK'); $db->query('ROLLBACK');
// Set throw exceptions back
$db->throwExeptions($db_throw_exceptions);
return; return;
} }
// Commit transaction // Commit transaction
$db->query('COMMIT'); $db->query('COMMIT');
// Set throw exceptions back
$db->throwExeptions($db_throw_exceptions);
} }
/** /**
@ -185,7 +197,7 @@ function calculate_operator_statistics() {
function calculate_page_statistics() { function calculate_page_statistics() {
// Prepare database // Prepare database
$db = Database::getInstance(); $db = Database::getInstance();
$db->throwExeptions(true); $db_throw_exceptions = $db->throwExeptions(true);
try { try {
// Start transaction // Start transaction
@ -277,11 +289,17 @@ function calculate_page_statistics() {
E_USER_WARNING E_USER_WARNING
); );
$db->query('ROLLBACK'); $db->query('ROLLBACK');
// Set throw exceptions back
$db->throwExeptions($db_throw_exceptions);
return; return;
} }
// Commit transaction // Commit transaction
$db->query('COMMIT'); $db->query('COMMIT');
// Set throw exceptions back
$db->throwExeptions($db_throw_exceptions);
} }
?> ?>