Change db safety outside transactions

This commit is contained in:
Ron Pedde 2006-08-17 05:05:48 +00:00
parent bc261933b9
commit e8b1520ffc
2 changed files with 8 additions and 8 deletions

View File

@ -354,8 +354,8 @@ int db_sqlite2_event(int event_type) {
case DB_SQL_EVENT_SONGSCANSTART: case DB_SQL_EVENT_SONGSCANSTART:
if(db_sqlite2_reload) { if(db_sqlite2_reload) {
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");
db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
} else { } else {
db_sqlite2_exec(NULL,E_DBG,"drop table updated"); db_sqlite2_exec(NULL,E_DBG,"drop table updated");
db_sqlite2_exec(NULL,E_FATAL,"create temp table updated (id int)"); db_sqlite2_exec(NULL,E_FATAL,"create temp table updated (id int)");
@ -366,21 +366,21 @@ int db_sqlite2_event(int event_type) {
case DB_SQL_EVENT_SONGSCANEND: case DB_SQL_EVENT_SONGSCANEND:
if(db_sqlite2_reload) { if(db_sqlite2_reload) {
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal");
db_sqlite2_exec(NULL,E_FATAL,"commit transaction"); db_sqlite2_exec(NULL,E_FATAL,"commit transaction");
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal");
db_sqlite2_exec(NULL,E_FATAL,"create index idx_path on songs(path,idx)"); db_sqlite2_exec(NULL,E_FATAL,"create index idx_path on songs(path,idx)");
db_sqlite2_exec(NULL,E_DBG,"delete from config where term='rescan'"); db_sqlite2_exec(NULL,E_DBG,"delete from config where term='rescan'");
} }
break; break;
case DB_SQL_EVENT_PLSCANSTART: case DB_SQL_EVENT_PLSCANSTART:
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");
db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
break; break;
case DB_SQL_EVENT_PLSCANEND: case DB_SQL_EVENT_PLSCANEND:
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");
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal");
if(db_sqlite2_reload) { 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)");

View File

@ -386,8 +386,8 @@ int db_sqlite3_event(int event_type) {
case DB_SQL_EVENT_SONGSCANSTART: case DB_SQL_EVENT_SONGSCANSTART:
if(db_sqlite3_reload) { if(db_sqlite3_reload) {
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");
db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
} else { } else {
db_sqlite3_exec(NULL,E_DBG,"drop table updated"); db_sqlite3_exec(NULL,E_DBG,"drop table updated");
db_sqlite3_exec(NULL,E_FATAL,"create temp table updated (id int)"); db_sqlite3_exec(NULL,E_FATAL,"create temp table updated (id int)");
@ -398,21 +398,21 @@ int db_sqlite3_event(int event_type) {
case DB_SQL_EVENT_SONGSCANEND: case DB_SQL_EVENT_SONGSCANEND:
if(db_sqlite3_reload) { if(db_sqlite3_reload) {
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = normal");
db_sqlite3_exec(NULL,E_FATAL,"commit transaction"); db_sqlite3_exec(NULL,E_FATAL,"commit transaction");
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = normal");
db_sqlite3_exec(NULL,E_FATAL,"create index idx_path on songs(path,idx)"); db_sqlite3_exec(NULL,E_FATAL,"create index idx_path on songs(path,idx)");
db_sqlite3_exec(NULL,E_DBG,"delete from config where term='rescan'"); db_sqlite3_exec(NULL,E_DBG,"delete from config where term='rescan'");
} }
break; break;
case DB_SQL_EVENT_PLSCANSTART: case DB_SQL_EVENT_PLSCANSTART:
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");
db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
break; break;
case DB_SQL_EVENT_PLSCANEND: case DB_SQL_EVENT_PLSCANEND:
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");
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal");
if(db_sqlite3_reload) { 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)");