Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2307
  • Last Modified:

The connection pool for database exception in android ??

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
rigelnet
Asked:
rigelnet
  • 3
  • 2
1 Solution
 
girionisCommented:
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
 
rigelnetAuthor Commented:
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
 
girionisCommented:
What do these two threads do? Do they update the same table? There might be a deadlock involved.
0
 
rigelnetAuthor Commented:
Same database method is called from two background thread repeatedly .
0
 
girionisCommented:
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now