Solved

The connection pool for database exception  in android ??

Posted on 2014-04-01
5
2,026 Views
Last Modified: 2014-04-23
The connection pool for database '/data/data/com.example/databases/emp.db' has been unable to grant a connection to thread 1 (main) with flags 0x6 for 4.0 seconds.
0
Comment
Question by:rigelnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 39971360
What connection pool API are you using? You probably ran out of connections. Check two things:

a) You don't have too many connections open
b) You don't have too many transactions (that hold db connections) still running. Make sure that you always end your transactions.
0
 

Author Comment

by:rigelnet
ID: 39971750
We are not using any api for database connection pool .
we are just using "DB.execSQL("BEGIN TRANSACTION");" and "DB.execSQL("END TRANSACTION");"  in a database method . This database method is called from two background thread repeatedly .
0
 
LVL 35

Expert Comment

by:girionis
ID: 39971795
What do these two threads do? Do they update the same table? There might be a deadlock involved.
0
 

Author Comment

by:rigelnet
ID: 39974265
Same database method is called from two background thread repeatedly .
0
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 39974305
Do these threads finish calling this database method before they call it again? And if they finish, do they close the resources properly? If not then you're probably running out of connections.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Big gap on page with the Samsung Galaxy S7 EDGE and no other mobile device! 3 143
move file from android 2 70
will india ph work in usa? 21 117
moto 4g phone enable finger print 4 73
A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question