Couchbase PhoneGap - W/SQLiteConnectionPool: The connection pool... delay!

I have developed an app with cordova, Couchbase and Ionic Framework.
Everything is working fine both in iOS and Android 4.4.x, but the version on Android is terribly slow to retrieve all data from the server (both devices on the same network and around 5-6MB of data to download).
iOS takes maybe 20-30 sec, while Android takes 10-15 min.
Do you have any idea what could be the problem?

I have checked all logs and it seems that the problem is here:

05:42 W/SQLiteConnectionPool: The connection pool for database '+data+data+com_...+files+..._cblite' has been unable to grant a connection to thread 3211 (CBLManagerWorkExecutor) with flags 0x1 for 36.019 seconds.

Similar log is repeated during all downloading phase from the gateway server.
Any suggestion where the problem may be?

Hi @lucapale,

I need some information from you first.

  • What version of Couchbase Lite PhoneGap plugin are you using?
  • Does your app replicate against Sync Gateway or CouchDB?
  • How many documents do you try to replicate?
  • Average document size? 5-6MB / number of docs


Thank you for your answer.
I am using last version 1.0.4.
The server is Couchbase 3 with sync gateway.
The number of documents is probably in the range of one thousand, but they are divided in several buckets and the delay does not seem to happen on each single document, but on batches of them.
Average doc size is of few bytes (just text), plus there are a few pictures as attachment that probably make 2-3MB out of the total.
Thanks again,

Hi @lucapale,

Replication issue was fixed after 1.0.4 release. Following is temporary build that we built around a month ago. Could you please try if this build can address your issue?

Steps to update plugin

phonegap plugin rm com.couchbase.lite.phonegap
phonegap plugin add ~/Downloads/Couchbase-Lite-PhoneGap-Plugin_1.0.4-47-63
phonegap platform rm android
phonegap platform add android
phonegap run android
phonegap run android --verbose

Let us know if this works.

PS. We are currently working for v1.1.0 release.

OK. Done. I had to update also the JDK to 1.8.0, which brought some other issues, but now it works.
It is faster than the previous, but not yet as fast as the iOS version.
I still get some of these logs:

01:12 W/SQLiteConnectionPool: The connection pool for database '+data+data+com_diveplanapp_beta+files+diveplan_cblite' has been unable to grant a connection to thread 1153 (CBLRequestWorker-e93ca-0) with flags 0x2 for 16.001001 seconds.

That I think are contributing to the delay. The time mentioned in the logs is anyway lower than before.
Waiting for the new version to see if it improves further.