sqlite3_open_v2(strDbName,sqlite_p, SQLITE_OPEN_READWRITE| SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, NULL);
 
  
 
 static int callback_in_busy(void *ptr, int count)
{
    int timeout = *((int *)ptr);
    
    usleep(timeout);
    return 1;
}
static void SqlGetLock(sqlite3 *sqlite_p, int ms)
{
    if (ms > 0)
    {
        sqlite3_busy_handler(sqlite_p, callback_in_busy, (void*)&ms);
    }
    else
    {
        sqlite3_busy_handler(sqlite_p, 0, 0);
    }
}
int SqlExec(sqlite3 *sqlite_p, const char *strSql)
{
    char *pErrMsg = NULL;
    int rc = SQLITE_OK;
    int ret = -1;
    
    SqlGetLock(sqlite_p, 200);    
    rc = sqlite3_exec(sqlite_p, strSql, NULL, NULL, &pErrMsg);
    
    if (rc != SQLITE_OK)
    {
        printf("%s %d sqlite3_exec error:%s, strSql = [%s].\n", 
            __func__, __LINE__, sqlite3_errmsg(sqlite_p), strSql);
        if (pErrMsg != NULL)
        {
            printf("%s %d sqlite3_exec error:%s\n", __func__, __LINE__, pErrMsg);
            sqlite3_free(pErrMsg);
        }
        ret = -1;
    }
    else
    {
        ret = 0;
    }
    return ret;
}