Project

General

Profile

Actions

Bug #18252

closed

Duplicate entry on cache_pagesection on reloading twice

Added by Ivan Gomez about 16 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2008-02-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If I reload a page in the frontend twice or two or more persons access the same page at almost the same time, an SQL error in tabe cache_pagesection is show.

That's a concurrence problem incorrectly fixed in http://bugs.typo3.org/view.php?id=4581

That's a concurrence problem is in that piece of code.

Two or more users can do the insert at same time . There aren't transactions or another way to control concurrence and then we can't assume that condition ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 0) is true when a process do the insert because another process could do the insert before.

$GLOBALS['TYPO3_DB']->exec_UPDATEquery('cache_pagesection', 'page_id=' . intval($GLOBALS['TSFE']->id) . ' AND mpvar_hash=' . $mpvar_hash, $dbFields);

if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 0) {
$dbFields['page_id'] = intval($GLOBALS['TSFE']->id);
$dbFields['mpvar_hash'] = $mpvar_hash;
// HERE ===> two or more execs at the same time
$GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_pagesection', $dbFields);

}

(issue imported from #M7590)


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #18253: Duplicate entry on cache_pagesection on reloading twiceClosedChristian Kuhn2008-02-19

Actions
Actions #1

Updated by Christian Kuhn about 14 years ago

Duplicate of #18253

Actions #2

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF