apply WAL mode 10/66110/2
authorJeesun Kim <iamjs.kim@samsung.com>
Fri, 15 Apr 2016 08:24:40 +0000 (17:24 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Tue, 19 Apr 2016 00:04:08 +0000 (09:04 +0900)
Change-Id: I67d27ebfc8adfc1780c856ce7bc7289edf4f09a0

build-util/schema.sql
server/cal_server_schema.c
server/db/cal_db.h

index ba935fd..db758da 100644 (file)
@@ -16,6 +16,7 @@
 -- limitations under the License.
 --
 PRAGMA user_version = 105;
+PRAGMA journal_mode = WAL;
 
 CREATE TABLE schedule_table
 (
index 9afbd28..f2ddcbc 100644 (file)
 
 static inline int __remake_db_file(char* db_path)
 {
-       int ret, fd;
+       int ret;
        char *errmsg;
        sqlite3 *db;
        char db_file[CAL_STR_MIDDLE_LEN] = {0};
-       char jn_file[CAL_STR_MIDDLE_LEN] = {0};
 
        snprintf(db_file, sizeof(db_file), "%s/%s", db_path ? db_path : DB_PATH, CALS_DB_NAME);
 
@@ -51,26 +50,6 @@ static inline int __remake_db_file(char* db_path)
                sqlite3_free(errmsg);
        }
        db_util_close(db);
-
-       fd = open(db_file, O_CREAT | O_RDWR, 0660);
-       if (-1 == fd) {
-               ERR("open Fail ");
-               return -1;
-       }
-       fchmod(fd, CAL_SECURITY_DEFAULT_PERMISSION);
-       close(fd);
-
-       snprintf(jn_file, sizeof(jn_file), "%s/%s", db_path ? db_path : DB_PATH, CALS_JN_NAME);
-       DBG("[%s]", jn_file);
-
-       fd = open(jn_file, O_CREAT | O_RDWR, 0660);
-       if (-1 == fd) {
-               ERR("open Fail ");
-               return -1;
-       }
-       fchmod(fd, CAL_SECURITY_DEFAULT_PERMISSION);
-       close(fd);
-
        return 0;
 }
 
index 768dd36..0d819aa 100644 (file)
 #include "calendar_list.h"
 
 #define CALS_DB_NAME ".calendar-svc.db"
-#define CALS_JN_NAME ".calendar-svc.db-journal"
 #define DB_PATH tzplatform_getenv(TZ_USER_DB)
 #define DATA_PATH tzplatform_getenv(TZ_USER_DATA)
 #define CAL_DB_FILE tzplatform_mkpath(TZ_USER_DB, ".calendar-svc.db")
-#define CAL_JN_FILE tzplatform_mkpath(TZ_USER_DB, ".calendar-svc.db-journal")
 #define CAL_DATA_PATH tzplatform_mkpath(TZ_USER_DATA, "calendar-svc")
 
 /* For Security */