Solved

The connection pool for database exception  in android ??

Posted on 2014-04-01
5
1,800 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Recently Amazon announced their entry in the tablet device called the Amazon Kindle Fire. Some of you might have used an Ipad or have considered buying one. While they're similar in form and function in that they both have color displays with multit…
A short article about a problem I had getting the GPS LocationListener working.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now