Skip to content

Commit f5d9335

Browse files
committed
Allows the global connection pool size for WAL mode to be adjusted
1 parent 8166f30 commit f5d9335

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sqlcipher/src/main/java/net/zetetic/database/sqlcipher/SQLiteGlobal.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public final class SQLiteGlobal {
4242

4343
private static final Object sLock = new Object();
4444
private static int sDefaultPageSize = 4096;
45+
private static int sWALConnectionPoolSize = 10;
4546

4647
private static native int nativeReleaseMemory();
4748

@@ -108,11 +109,18 @@ public static int getWALAutoCheckpoint() {
108109
return Math.max(1, value);
109110
}
110111

112+
/**
113+
* Sets the connection pool size for WAL mode.
114+
*/
115+
public static void setWALConnectionPoolSize(int value) {
116+
sWALConnectionPoolSize = value;
117+
}
118+
111119
/**
112120
* Gets the connection pool size when in WAL mode.
113121
*/
114122
public static int getWALConnectionPoolSize() {
115-
int value = 10;
116-
return Math.max(2, value);
123+
return sWALConnectionPoolSize;
117124
}
125+
118126
}

0 commit comments

Comments
 (0)