aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-08 14:14:02 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-08 14:14:02 +0200
commit0f842c1aea74792d9b6f7e41e374c5aa0ec745fb (patch)
treed7a59dfff2b6c11678ee3e0216e1d71f18cbeca5 /app/Models/EntryDAOSQLite.php
parent436f9a432b5636c6425c689065090eb7c33e37b5 (diff)
SQL: removed superfluous transactions to avoid some dead locks
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
-rw-r--r--app/Models/EntryDAOSQLite.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index efcbed521..3dabce4b2 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -75,7 +75,6 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
Minz_Log::record($nb . 'Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG);
}
- $this->bd->beginTransaction();
$sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=1 WHERE is_read=0 AND id <= ?';
if ($onlyFavorites) {
$sql .= ' AND is_favorite=1';
@@ -86,16 +85,13 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadEntries 1: ' . $info[2], Minz_Log::ERROR);
- $this->bd->rollBack();
+ Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR);
return false;
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) {
- $this->bd->rollBack();
return false;
}
- $this->bd->commit();
return $affected;
}
@@ -104,7 +100,6 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$idMax = time() . '000000';
Minz_Log::record($nb . 'Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG);
}
- $this->bd->beginTransaction();
$sql = 'UPDATE `' . $this->prefix . 'entry` '
. 'SET is_read=1 '
@@ -115,15 +110,12 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR);
- $this->bd->rollBack();
return false;
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads($id, false))) {
- $this->bd->rollBack();
return false;
}
- $this->bd->commit();
return $affected;
}