Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3234192
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:21:46+00:00 2026-05-17T17:21:46+00:00

I have a normal SQLite database in my app, managed through my own ContentProvider

  • 0

I have a normal SQLite database in my app, managed through my own ContentProvider and implemented via SQLiteOpenHelper.

On the Droid only, every few weeks or so, the database just disappears. I have several users who wrote me about that, and I’ve seen it myself too now. I added some debug info (hard to repro when you only see it every few weeks), and in one instance, it just happened inbetween widget updates – first, the widget is displayed and shows the data just fine, the next time, the SQLiteOpenHelper’s onCreate is called.

The app itself does some multi-threaded shenanigans, but all ContentProvider implementations have the synchronized keyword, all access to the database is via the content provider, and in the instance described above, there is no multi-threading going on (the app itself hadn’t been running, just the widget).

And again, this is only on the Droid. I’ve never seen it on the G1. I never close the database, but it being a content provider, it sounds like I’m not supposed to do that in the first place (I remember hackbod saying that the idea is that the OS will close the app’s process when necessary, which will automatically close the database).

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:21:47+00:00Added an answer on May 17, 2026 at 5:21 pm

    According to the documentation, SQLiteDatabase has locking enabled by default (SQLiteDatabase.setLockingEnabled). In my app, I explicitly turn it on after opening, and added some other more paranoid synchronization to make sure multiple threads can’t access the database at the same time, and that seems to have fixed it.

    I’m still curious as to why this problem only ever occured on the Motorola Droid, and I had this hunch that this phone has locking disabled by default, but that sounds a bit weird – the Droid, after all, is one of the phones with almost no customization by the manufacturer at all.

    In any case, explicitly enabling locking and proper synchronization did the trick for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SQLITE database in my iPhone app. I have a refresh button
I have 2 processes: 1 is writing to a sqlite database, 1 is reading
I am using C# and Windows Forms. I have a normal progress bar working
I have a table in SQL server that has the normal tree structure of
I have the following div layout: Everything is fine when I put normal txt
I have a program that needs to run as a normal user most of
I have a table that's generated by a normal PHP loop. What I want
I have two files with slight differences. A normal diff will show me the
Is it normal to modify setter arguments? Let's imagine that we have setString method.
I am programming with normal pointers, but I have heard about libraries like Boost

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.