Sorry for tuning in late to the ongoing discussion...

I ran into this with a developer back in January:

http://stackoverflow.com/questions/4718934/sqlite-issues-with-htc-desire-hd

In that case, it was an HTC Desire Z.

I do hope that, if they enable WAL in stock Android someday, we get
fair warning...

On Thu, Aug 4, 2011 at 3:05 AM, Nikolay Elenkov
<[email protected]> wrote:
> On Thu, Aug 4, 2011 at 4:00 PM, Miguel Morales <[email protected]> 
> wrote:
>> Ok, so this is weird.  It seems that WAL mode is being activated from
>> the java code.
>> I just opened the bad database file in 3.7x and ran the command:
>> PRAGMA journal_mode=DELETE
>> to disable WAL.  I was then able to open the database file in the 3.6x 
>> version.
>
> It's in android_database_SQLiteDatabase.cpp. If the database is not read-only,
> it tries to use WAL:
>
>  if(!(flags & OPEN_READONLY) && (use_wal_mode(path8))) {
>     // Configure databases to run in WAL mode.
>     err = sqlite3_exec(handle,"PRAGMA journal_mode = WAL;",
>                        NULL, NULL,&zErrMsg);
>     if (SQLITE_OK != err) {
>        LOGE("sqlite3_exec - Failed to set WAL mode for [%s] \n", path8);
>        err = sqlite3_exec(handle,"PRAGMA journal_mode = DELETE;",
>                        NULL, NULL,&zErrMsg);
>        if(SQLITE_OK != err) {
>            LOGE("sqlite3_exec - Failed to set DELETE mode for [%s] \n", 
> path8);
>            throw_sqlite3_exception(env, handle);
>            goto done;
>        }
>     }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in NYC: http://marakana.com/training/android/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to