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

List:       kde-pim
Subject:    Re: [Kde-pim] Akonadi and Plasma Active
From:       Volker Krause <vkrause () kde ! org>
Date:       2013-01-25 12:41:50
Message-ID: 5247800.46W3xzl56m () vkpc9
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 24 January 2013 16:28:58 Kevin Krammer wrote:
> On Thursday, 2013-01-24, Marco Martin wrote:
> > On Thursday 24 January 2013, Marco Martin wrote:
> > > mQuery.prepare( statement ); at line 281 of querybuilder.cpp? seems to
> > > always return true
> > 
> > quite interesting finding:
> > in querybuilder.cpp, always there
> > 
> >  if ( QueryCache::contains( statement ) ) {
> >  
> >     mQuery = QueryCache::query( statement );
> >   
> >   } else {
> >   
> >     mQuery.prepare( statement );
> >     QueryCache::insert( statement, mQuery );
> >   
> >   }
> > 
> > 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).

I know that pretty much the same approach works fine in an other project 
which uses Sqlite and PostgreSQL, so both can - in theory - handle prepared 
queries. For PostgreSQL it also doesn't seem to be causing issues with 
Akonadi, Till is using it on Mac for example. The special thing about Sqlite 
in Akonadi is the thread safety patches we had to add on top.

So, what I could imagine is an active query object causes a lock to be held 
somewhere, which would be released in the dtor. Obviously, anything like that 
breaks with the caching.

Marco's patch looks good to me, definitely the safe place to add this check. 
We'd need to check where the cache is used to see what other options we have 
(keep in mind the auto-generated code!).

regards,
Volker

["signature.asc" (application/pgp-signature)]

_______________________________________________
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