wrap playlist scans in transaction

This commit is contained in:
Ron Pedde 2006-08-14 04:09:45 +00:00
parent 6891f3a169
commit 5e6575a153
2 changed files with 10 additions and 12 deletions

View File

@ -374,16 +374,15 @@ int db_sqlite2_event(int event_type) {
break; break;
case DB_SQL_EVENT_PLSCANSTART: case DB_SQL_EVENT_PLSCANSTART:
if(db_sqlite2_reload) {
db_sqlite2_exec(NULL,E_FATAL,"begin transaction"); db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous = off"); db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous = off");
}
break; break;
case DB_SQL_EVENT_PLSCANEND: case DB_SQL_EVENT_PLSCANEND:
if(db_sqlite2_reload) {
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal"); db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal");
db_sqlite2_exec(NULL,E_FATAL,"end transaction"); db_sqlite2_exec(NULL,E_FATAL,"end transaction");
if(db_sqlite2_reload) {
db_sqlite2_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)"); db_sqlite2_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)");
db_sqlite2_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid,songid)"); db_sqlite2_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid,songid)");

View File

@ -406,16 +406,15 @@ int db_sqlite3_event(int event_type) {
break; break;
case DB_SQL_EVENT_PLSCANSTART: case DB_SQL_EVENT_PLSCANSTART:
if(db_sqlite3_reload) {
db_sqlite3_exec(NULL,E_FATAL,"begin transaction"); db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = off"); db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = off");
}
break; break;
case DB_SQL_EVENT_PLSCANEND: case DB_SQL_EVENT_PLSCANEND:
if(db_sqlite3_reload) {
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal"); db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal");
db_sqlite3_exec(NULL,E_FATAL,"end transaction"); db_sqlite3_exec(NULL,E_FATAL,"end transaction");
if(db_sqlite3_reload) {
db_sqlite3_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)");
db_sqlite3_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid,songid)"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid,songid)");