Closed Bug 1014988 Opened 5 years ago Closed 5 years ago

Use Context.MODE_ENABLE_WRITE_AHEAD_LOGGING when opening databases

Categories

(Firefox for Android :: Data Providers, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 32

People

(Reporter: rnewman, Assigned: rnewman)

Details

Attachments

(1 file)

Added in API 16:

http://developer.android.com/reference/android/content/Context.html#MODE_ENABLE_WRITE_AHEAD_LOGGING

Much better than opening the DB then issuing a query to set up WAL! Faster, and probably safer, too.
This looks like the right approach.

Note that SQLiteOpenHelper encapsulates the mode flag mechanism; this API call was also added in API 16.
Comment on attachment 8429787 [details] [diff] [review]
Use Context.MODE_ENABLE_WRITE_AHEAD_LOGGING when opening databases. v1

Brian gets review on this, 'cos empty queue.

Tested locally on a KitKat device.
Attachment #8429787 - Flags: review?(bnicholson)
Comment on attachment 8429787 [details] [diff] [review]
Use Context.MODE_ENABLE_WRITE_AHEAD_LOGGING when opening databases. v1

Review of attachment 8429787 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/db/BrowserDatabaseHelper.java
@@ +1729,1 @@
>              db.setLockingEnabled(false);

Since you added an API level 16 check, you can move this into it since this doesn't do anything on 16+.
Attachment #8429787 - Flags: review?(bnicholson) → review+
https://hg.mozilla.org/mozilla-central/rev/dc94e2a05c97
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 32
You need to log in before you can comment on or make changes to this bug.