[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] Akonadi and Plasma Active
From:       Marco Martin <notmart () gmail ! com>
Date:       2013-01-24 17:05:35
Message-ID: 201301241805.36023.notmart () gmail ! com
[Download RAW message or body]

On Thursday 24 January 2013, Kevin Krammer wrote:
> > if i make the else branch to always execute (ie never using the cache)
> > it's still broken.
> > but, if i disable also QueryCache::insert( statement, mQuery );
> > so never inserting anything in the cache, all starts to work normally
> > again. ie even just saving those prepared queries somewhere makes it
> > fail.
> 
> I don't know enough about the database stuff but it seems we'll have to
> deactivate prepared queries when sqlite is being used (assuming it works
> with PostgreSQL).

attached patch partially fixes the issue, does it look correct?
still have to try on the device but the agents seem to work correctly after 
the first akonadi startup (the first time it runs it still have the symptoms)

-- 
Marco Martin

["nocacheSqlite.diff" (text/x-patch)]

diff --git a/server/src/storage/querycache.cpp b/server/src/storage/querycache.cpp
index 860aba0..5b683d5 100644
--- a/server/src/storage/querycache.cpp
+++ b/server/src/storage/querycache.cpp
@@ -18,6 +18,8 @@
  */
 
 #include "querycache.h"
+#include "dbtype.h"
+#include "datastore.h"
 
 #include <QSqlQuery>
 #include <QThreadStorage>
@@ -36,7 +38,11 @@ static QHash<QString, QSqlQuery>* cache()
 
 bool QueryCache::contains(const QString& queryStatement)
 {
-  return cache()->contains( queryStatement );
+  if ( DbType::type( DataStore::self()->database() ) == DbType::Sqlite ) {
+    return false;
+  } else {
+    return cache()->contains( queryStatement );
+  }
 }
 
 QSqlQuery QueryCache::query(const QString& queryStatement)
@@ -46,5 +52,7 @@ QSqlQuery QueryCache::query(const QString& queryStatement)
 
 void QueryCache::insert(const QString& queryStatement, const QSqlQuery& query)
 {
-  cache()->insert( queryStatement, query );
+  if ( DbType::type( DataStore::self()->database() ) != DbType::Sqlite ) {
+    cache()->insert( queryStatement, query );
+  }
 }


_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic