Comment 22 for bug 1051106

Revision history for this message
Max Linke (max-linke) wrote :

But keeping step 2 as one transaction is the reason why the library scan is so fast now. If we use serveral transaction then the libraryscanner will be bound by the time it takes sqlite to complete a single transaction, which is really slow due to a lot of error/consistency checking of sqlite.

I'm also not sure about the race-conditions. AFAIK SQLite supports only one transaction at a time and will fail others during an active transaction. So what happens if we start a transaction in the UI thread the same time as a transaction happens in the libraryscanner thread. One of them will fail. It will be possible to recover from that and to retry the transaction in the scanner but there is no straigtforward way to do this in the UI.

I'm still in favor of keeping Phase 2 in a transaction.