-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
android版出现 has been unable to grant a connection to thread #129
Comments
你这是连接池被占用了,检查一下是否transaction打开了没有关闭。 |
我检查过代码,所有调用database.beginTransaction();都会在finally中调用database.endTransaction();
|
这个应该是死锁,考虑如下场景:
默认情况(非WAL)下,数据库连接只有1个,因此造成死锁。Thread A 和 Thread B 不一定是主线程,任何一组线程达到了死锁,将导致连接不能释放继而锁死其他访问DB的线程。看你的traces,很有可能是 synchronized 建议排查方法:
建议规避方法:
|
感谢耐心解答~ |
这个问题今天终于复现了,按照你的方法,我抓住了dump日志,但是有些看不明白,这个日志显示的连接释放了吗? |
@droidphone 看你关了issue,请问你怎么解决的呢? |
1 similar comment
@droidphone 看你关了issue,请问你怎么解决的呢? |
日志打印:
W/WCDB.SQLiteConnectionPool: The connection pool for database '/data/data/xxx/databases/xxx.db' has been unable to grant a connection to thread 8954 (pool-6-thread-5) with flags 0x1 for 1938.4281 seconds.
Connections: 0 active, 1 idle, 0 available.
不知道为什么获取不到数据库连接?
The text was updated successfully, but these errors were encountered: