#include "MsgPluginManager.h"
#include "MsgStorageHandler.h"
+#define MSG_DB_ACCESS_MAX_COUNT 10
#define MSG_DB_VERSION 2
/*==================================================================================================
msg_error_t MsgStoDBVerCheck()
{
MsgDbHandler *dbHandle = getDbHandle();
+#if 1 /* TODO: need to improve this code later */
+ int cnt = MSG_DB_ACCESS_MAX_COUNT;
+ while (cnt--) {
+ if (dbHandle->connect() == MSG_SUCCESS)
+ break;
+
+ if (cnt == 0) {
+ MSG_ERR("db connect try count over %d", MSG_DB_ACCESS_MAX_COUNT);
+ return MSG_ERR_DB_CONNECT;
+ }
+
+ MSG_DEBUG("waiting for mount /opt/usr/ cnt [%d]", cnt);
+ sleep(1);
+ }
+#endif
int dbVersion = 0;
char sqlQuery[MAX_QUERY_LEN+1];
return MSG_SUCCESS;
} else if (ret == SQLITE_PERM){
MSG_DEBUG("DB Connect Fail [%d]", ret);
+ disconnect();
return MSG_ERR_PERMISSION_DENIED;
} else {
MSG_DEBUG("DB Connect Fail [%d]", ret);
+ disconnect();
return MSG_ERR_DB_CONNECT;
}
} else {