The connection pool for database '/data/data/msv_database.db' has been unable to grant a connection. Connections: 0 active, 1 idle, 0 available

后端 未结 2 1226
自闭症患者
自闭症患者 2021-02-13 20:11

I m getting following error:while accessing database from two different threads using single database object throughout the application

The connection pool for database

2条回答
  •  悲哀的现实
    2021-02-13 20:39

    I hope this is relevant to what you are facing. I am keeping a hold of SQLiteOpenHelper within a contentProvider. I was adding to my CRUD operations db.beginTransaction, db.setTransactionSuccessful, and db.endTransaction. I removed them, and that solved the issue I was having as I was calling my contentProvider from a loader and an intentService. Strange, many have mentioned that these commands are important to avoid the error.

    https://github.com/juanmendez/jm_android_dev/blob/master/12.alarms/06.magazineAppWithAlarm/app/src/main/java/info/juanmendez/android/intentservice/service/provider/crud/MagazineCrud.java

提交回复
热议问题