We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have seen this error:
at android.database.sqlite.SQLiteDatabase.dbopen(Native Method) 11at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:2005) 12at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:905) 13at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:197) 14at uk.co.jarofgreen.cityoutdoors.Storage.getFeatures(Storage.java:148) 15at uk.co.jarofgreen.cityoutdoors.UI.BrowseMapActivity$MarkerTask.doInBackground(BrowseMapActivity.java:240) 16at uk.co.jarofgreen.cityoutdoors.UI.BrowseMapActivity$MarkerTask.doInBackground(BrowseMapActivity.java:1)
Reading up, there are several steps to look into:
try {} finally {} on all db helper calls to make sure close is called in case of exception.
Singleton Helper, only one?
Is a Synchronized Lock something to look into?
http://stackoverflow.com/questions/7657223/sqlite-exception-database-is-locked-issue
public class DbExp extends SQLiteOpenHelper{ public static String Lock = "dblock"; private static final String DATABASE_NAME = "db.db"; private static final String TABLE_NAME = "table_name"; public void delete(Context mContext){ synchronized(Lock) { SQLiteDatabase db = getWritableDatabase(); db.delete(TABLE_NAME, null, null); db.close(); } } public void insert(){ synchronized(Lock) { SQLiteDatabase db = getWritableDatabase(); db.insert(TABLE_NAME, ..., ...); db.close(); } } }```
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Have seen this error:
Reading up, there are several steps to look into:
try {} finally {} on all db helper calls to make sure close is called in case of exception.
Singleton Helper, only one?
Is a Synchronized Lock something to look into?
http://stackoverflow.com/questions/7657223/sqlite-exception-database-is-locked-issue
The text was updated successfully, but these errors were encountered: