Skip to content

close() was never explicitly called on database '/data/data/package/databases/db'  #111

Closed
@itsmechlark

Description

@itsmechlark

I receive this following error for calling getWritableDatabase("password"). I their any solution cause I'm combining greenDAO and this project for multi-threading access of databse. By declaring:
Application


public static DaoDatabaseHandler mDaoDB;
public static SQLiteDatabase mWritableDatabase;

In my helper code:


public static synchronized DaoDatabaseHandler getInstance(Context context) {
        if (helper == null) {
            helper = new DaoDatabaseHandler(context, DATABASE_NAME, null);
        }
        return helper;
    }

Log


11-22 09:55:21.650: E/Database(1609): close() was never explicitly called on database '/data/data/package/databases/db' 
11-22 09:55:21.650: E/Database(1609): net.sqlcipher.database.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
11-22 09:55:21.650: E/Database(1609):   at net.sqlcipher.database.SQLiteDatabase.(SQLiteDatabase.java:1919)
11-22 09:55:21.650: E/Database(1609):   at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:871)
11-22 09:55:21.650: E/Database(1609):   at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:899)
11-22 09:55:21.650: E/Database(1609):   at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:127)
11-22 09:55:21.650: E/Database(1609):   at com.cdasia.cdasiaonline.CDAsiaOnline.onCreate(CDAsiaOnline.java:52)
11-22 09:55:21.650: E/Database(1609):   at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
11-22 09:55:21.650: E/Database(1609):   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4225)
11-22 09:55:21.650: E/Database(1609):   at android.app.ActivityThread.access$1300(ActivityThread.java:140)
11-22 09:55:21.650: E/Database(1609):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1288)
11-22 09:55:21.650: E/Database(1609):   at android.os.Handler.dispatchMessage(Handler.java:99)
11-22 09:55:21.650: E/Database(1609):   at android.os.Looper.loop(Looper.java:137)
11-22 09:55:21.650: E/Database(1609):   at android.app.ActivityThread.main(ActivityThread.java:4895)
11-22 09:55:21.650: E/Database(1609):   at java.lang.reflect.Method.invokeNative(Native Method)
11-22 09:55:21.650: E/Database(1609):   at java.lang.reflect.Method.invoke(Method.java:511)
11-22 09:55:21.650: E/Database(1609):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
11-22 09:55:21.650: E/Database(1609):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
11-22 09:55:21.650: E/Database(1609):   at dalvik.system.NativeStart.main(Native Method)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions