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.
rigelnetAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
girionisConnect With a Mentor Commented:
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
 
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
All Courses

From novice to tech pro — start learning today.