Commit 0d378e59 authored by Carsten  Rose's avatar Carsten Rose

Merge branch '8933brokenRecordLock' into 'master'

8933broken record lock

See merge request !175
parents 780e251d 9eefd38a
Pipeline #2268 passed with stages
in 2 minutes and 29 seconds
......@@ -280,8 +280,8 @@ FORM_LOG_EXPIRE (typically 1800 seconds).
* Correspondig expired logfiles will be deleted.
* Active logfiles will be filled.
Errormessages & Exceptions
==========================
Error Messages & Exceptions
===========================
* Exception types:
* Code
......
......@@ -272,7 +272,8 @@ class Dirty {
$record = $this->dbArray[$this->dbIndexData]->sql("SELECT * FROM $tableName WHERE $primaryKey=?", ROW_EXPECT_1, [$recordId], "Record to lock not found.");
$expire = date('Y-m-d H:i:s', strtotime("+" . $tableVars[F_RECORD_LOCK_TIMEOUT_SECONDS] . " seconds"));
# Dirty workaround: setting the 'expired timestamp' minus 1 second guarantees that the client ask for relock always if the timeout is expired.
$expire = date('Y-m-d H:i:s', strtotime("+" . $tableVars[F_RECORD_LOCK_TIMEOUT_SECONDS] - 1 . " seconds"));
// Write 'dirty' record
$this->dbArray[$this->dbIndexQfq]->sql("INSERT INTO Dirty (`sip`, `tableName`, `recordId`, `expire`, `recordHashMd5`, `feUser`, `qfqUserSessionCookie`, `dirtyMode`, `remoteAddress`, `created`) " .
"VALUES ( ?,?,?,?,?,?,?,?,?,? )", ROW_REGULAR,
......@@ -394,7 +395,6 @@ class Dirty {
return $answer;
}
if ($formMode == FORM_DELETE) {
// Check if the lock is timed out
if ($lockTimeout > 0 && $rcRecordDirty[DIRTY_EXPIRE] < date('Y-m-d H:i:s')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment