Search code examples
javaandroidsqliteandroid-database

Timeout exception in sqlite


Error: java.util.concurrent.TimeoutException: android.database.sqlite.SQLiteConnection.finalize() timed out after 10 seconds

I get this error but didn't find any specific line in project.Below is my logcat output:

    java.util.concurrent.TimeoutException: android.database.sqlite.SQLiteConnection.finalize() timed out after 10 seconds
    at android.database.sqlite.SQLiteConnection.nativeClose(Native Method)
    at android.database.sqlite.SQLiteConnection.dispose(SQLiteConnection.java:238)
    at android.database.sqlite.SQLiteConnection.finalize(SQLiteConnection.java:178)
    at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:202)
    at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:185)
    at java.lang.Thread.run(Thread.java:818)

Solution

  • Garbage collector tries to clear your SQLiteConnection instance, which you have forgot to close yourself. Take care of close()ing db instance.