MDL-30026 improve session lock - stronger detection for oracle

This commit is contained in:
Eloy Lafuente (stronk7)
2011-11-13 19:23:53 +01:00
parent d16b0197de
commit da3a1f3ae7
+3 -7
View File
@@ -1628,16 +1628,12 @@ class oci_native_moodle_database extends moodle_database {
$this->query_start($sql, $params, SQL_QUERY_AUX);
$stmt = $this->parse_query($sql);
$this->bind_params($stmt, $params);
$start = time();
$result = oci_execute($stmt, $this->commit_status);
$end = time();
$this->query_end($result, $stmt);
oci_free_statement($stmt);
if ($end - $start >= $timeout) {
//TODO: there has to be a better way to find out if lock obtained
if ($result === false) { // Any failure in get_lock() raises error, causing return of bool false
throw new dml_sessionwait_exception();
}
$this->query_end($result, $stmt);
oci_free_statement($stmt);
}
public function release_session_lock($rowid) {