Only use transactions on reload to avoid busy errors

This commit is contained in:
Ron Pedde 2006-01-20 15:55:51 +00:00
parent 2967af19ea
commit b20dece00b
2 changed files with 6 additions and 6 deletions

View File

@ -364,13 +364,13 @@ int db_sqlite2_event(int event_type) {
break;
case DB_SQL_EVENT_PLSCANSTART:
db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
if(db_sqlite2_reload)
db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
break;
case DB_SQL_EVENT_PLSCANEND:
db_sqlite2_exec(NULL,E_FATAL,"end transaction");
if(db_sqlite2_reload) {
db_sqlite2_exec(NULL,E_FATAL,"end transaction");
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal");
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)");

View File

@ -383,13 +383,13 @@ int db_sqlite3_event(int event_type) {
break;
case DB_SQL_EVENT_PLSCANSTART:
db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
if(db_sqlite3_reload)
db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
break;
case DB_SQL_EVENT_PLSCANEND:
db_sqlite3_exec(NULL,E_FATAL,"end transaction");
if(db_sqlite3_reload) {
db_sqlite3_exec(NULL,E_FATAL,"end transaction");
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal");
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)");