Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit 37cc1f2

Browse files
authored
Merge pull request #948 from couchbase/feature/issue_1352
Fixed https://github.com/couchbase/couchbase-lite-java-core/issues/1352
2 parents 1d9fed9 + 475726f commit 37cc1f2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/com/couchbase/lite/android/AndroidSQLiteStorageEngine.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package com.couchbase.lite.android;
1717

18+
import android.os.Build;
1819
import android.os.Looper;
1920

2021
import com.couchbase.lite.internal.database.DatabasePlatformSupport;
@@ -46,4 +47,14 @@ public boolean isMainThread() {
4647
protected String getICUDatabasePath() {
4748
return ICUUtils.getICUDatabasePath(context);
4849
}
50+
51+
@Override
52+
protected int getWALConnectionPoolSize() {
53+
// Crash when running with SQLCipher
54+
// https://github.com/couchbase/couchbase-lite-java-core/issues/1352
55+
// We observed SQLCipher crashes with multiple connections on Android API 19 (x86).
56+
// Android 5.x (LOLLIPOP/API21) or higher uses multiple connections.
57+
// Android 4.x (API 20) or lower uses single connection mode.
58+
return Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP ? 1 : 4;
59+
}
4960
}

0 commit comments

Comments
 (0)