The connection pool for the database "/data/data/msv_database.db" could not provide a connection. Connections: 0 active, 1 idle, 0 available

I get the following error: when accessing a database from two different threads using a single database object throughout the application

Database Connection Pool
'/data/data/msv_database.db' could not connect to stream 802 (Connections: 0 active, 1 free, 0 available.

+6
source share
2 answers

You probably want to select a query in the table that is used for a transaction without a completed transaction earlier. Try endTransaction() in the last block of the transaction.

OR

You are updating two tables, and two different transactions contain different tables, pending the release of the other.

OR

It’s just that there are too many open connections, and the DB pool or pools are just getting confused.

Be that as it may, something is probably wrong from the above. Check carefully.

Details - The connection pool could not provide a connection to the stream .

+5
source

I hope this relates to what you are facing. I support SQLiteOpenHelper inside contentProvider. I added db.beginTransaction, db.setTransactionSuccessful and db.endTransaction to my CRUD operations. I deleted them, and this solved the problem that I encountered when I called my content provider from the bootloader and intent. Strange, many said that these commands are important in order to avoid mistakes.

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.

0
source

Source: https://habr.com/ru/post/974534/


All Articles