summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBang Kwang-Min <justine.bang@samsung.com>2013-03-18 21:13:06 +0900
committerBang Kwang-Min <justine.bang@samsung.com>2013-03-19 20:27:53 +0900
commit03f351e21e47c7ff15b4e2f11dcb374fc902cddb (patch)
treea643327ae288233910b11db11dfa414fdbfe2812
parent35bb5e8867b16db17911776c7ee60fb124105626 (diff)
downloaddownload-provider-03f351e21e47c7ff15b4e2f11dcb374fc902cddb.tar.gz
download-provider-03f351e21e47c7ff15b4e2f11dcb374fc902cddb.tar.bz2
download-provider-03f351e21e47c7ff15b4e2f11dcb374fc902cddb.zip
setting the property of sqlite3
: synchronous=OFF - do not ready to write to filesystem VACUUM - clear empty page Change-Id: I38c53c4b8043b66418eb90c36bacdd90aa085afd
-rwxr-xr-xprovider/download-provider-db.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/provider/download-provider-db.c b/provider/download-provider-db.c
index 28a69b1..efdf919 100755
--- a/provider/download-provider-db.c
+++ b/provider/download-provider-db.c
@@ -47,8 +47,10 @@ sqlite3 *g_dp_db_handle = 0;
// called when terminating process
void dp_db_close()
{
- if (g_dp_db_handle)
+ if (g_dp_db_handle) {
+ sqlite3_exec(g_dp_db_handle, "VACUUM;", 0, 0, 0); // remove empty page of db
db_util_close(g_dp_db_handle);
+ }
g_dp_db_handle = 0;
}
@@ -65,6 +67,7 @@ int dp_db_open()
}
sqlite3_exec(g_dp_db_handle, "PRAGMA journal_mode=PERSIST;", 0, 0, 0);
sqlite3_exec(g_dp_db_handle, "PRAGMA foreign_keys=ON;", 0, 0, 0);
+ sqlite3_exec(g_dp_db_handle, "PRAGMA synchronous=OFF;", 0, 0, 0); // do not ready to write to db
}
return g_dp_db_handle ? 0 : -1;
}