Problems with sqlite support with 1.4.8: no such table: uniqueid_temp

Colin Guthrie gmane at colin.guthr.ie
Tue Feb 26 01:32:18 UTC 2008


Colin Guthrie wrote:
> Gah, bang goes that easy way out of a debugging session... damn the
> linking time... damn it to hell ;)

OK, here's my suspicion. Can you tell me if it has legs and if it's
worth me trying to dig further?

I think it has something to do with playlists.

Let's say you have a large collection.

As you are rebuilding it, the scanner runs for a long time. It finds
playlists and populates these in the system. Meanwhile the
contextbrowser  may try and refresh the it's files in some capacity
(perhaps due to the fact playlists are found/updated?) which it does via
collectiondb instance.

However, perhaps the contextbrowser runs in a different thread than the
scanner and thus cannot access the temporary tables? In
CollectionDB::uniqueIdFromUrl() it detects whether it's scanning based
via a way that *is* threadsafe. So the contextbrowser which cannot
access the temp tables thinks it is currently scanning and tries to
access them?

This seems to me like the most plausible explanation. The code is a bit
of an uphill struggle when you are not familiar (I don't really know
what threads are running etc. and hence why I'm using words like
"possibly" and "perhaps" a lot ;))

I do see a QDeepCopy relating to bundles in playlistbrowseritem.cpp and
a call to uniqueIdFromUrl() from within metabundle so this looks like a
possible candidate as IIRC QDeepCopy is not thread safe?

To at least attempt to verify this theory I added a flag to
CollectionDB::uniqueIdFromUrl() to ignore the scanning detection and
setup metabundle's call to it to use this flag (the only place where I
set this flag). Low and behold the scan worked!!!!!!!!!!!!

So while I am kinda stabbing in the dark a fair bit here, I think I'm on
to something good. This may not be quite the right description but
perhaps, being more familiar with the code, you will go "a ha!" and
realise what could be going on.


Sorry if this is not clear but it's late and I've been staring at this
code for a while!!!


Col




More information about the Amarok mailing list