{
int rc;
char *db_path;
- int persist_wal = 1;
- int no_checkpoint = 1;
if (*app_info_db && *global_app_info_db) {
_D("Already initialized");
goto err;
}
- rc = sqlite3_file_control(*app_info_db, NULL,
- SQLITE_FCNTL_PERSIST_WAL, &persist_wal);
- if (rc) {
- _E("failed to sqlite3_file_control: %s",
- sqlite3_errmsg(*app_info_db));
- goto err;
- }
-
- rc = sqlite3_wal_autocheckpoint(*app_info_db, 0);
- if (rc) {
- _E("failed to sqlite3_wal_autocheckpoint: %s",
- sqlite3_errmsg(*app_info_db));
- goto err;
- }
-
- rc = sqlite3_db_config(*app_info_db, SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE,
- &no_checkpoint);
- if (rc) {
- _E("failed to execute sqlite3_db_config: %s",
- sqlite3_errmsg(*app_info_db));
+ rc = sqlite3_exec(*app_info_db, "PRAGMA journal_mode = PERSIST",
+ NULL, NULL, NULL);
+ if (SQLITE_OK != rc) {
+ _D("Fail to change journal mode");
goto err;
}
goto err;
}
- rc = sqlite3_file_control(*global_app_info_db, NULL,
- SQLITE_FCNTL_PERSIST_WAL, &persist_wal);
- if (rc) {
- _E("failed to sqlite3_file_control: %s",
- sqlite3_errmsg(*global_app_info_db));
- goto err;
- }
-
- rc = sqlite3_wal_autocheckpoint(*global_app_info_db, 0);
- if (rc) {
- _E("failed to sqlite3_wal_autocheckpoint: %s",
- sqlite3_errmsg(*global_app_info_db));
- goto err;
- }
-
- rc = sqlite3_db_config(*global_app_info_db,
- SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE,
- &no_checkpoint);
- if (rc) {
- _E("failed to execute sqlite3_db_config: %s",
- sqlite3_errmsg(*global_app_info_db));
+ rc = sqlite3_exec(*global_app_info_db, "PRAGMA journal_mode = PERSIST",
+ NULL, NULL, NULL);
+ if (SQLITE_OK != rc) {
+ _D("Fail to change journal mode");
goto err;
}