From 853d75d269026e72819e2cfd3084e0036fcc8271 Mon Sep 17 00:00:00 2001
From: Brian Carrier <carrier@sleuthkit.org>
Date: Fri, 26 Oct 2018 09:49:04 -0400
Subject: [PATCH] Increase global max statements.  Fixes problem when DB is
 under pressure.  Could go even higher

---
 .../src/org/sleuthkit/datamodel/SleuthkitCase.java   | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java b/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
index f81435afa..1b1d74871 100644
--- a/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
+++ b/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
@@ -9442,9 +9442,11 @@ private final class SQLiteConnections extends ConnectionPool {
 		SQLiteConnections(String dbPath) throws SQLException {
 			configurationOverrides.put("acquireIncrement", "2");
 			configurationOverrides.put("initialPoolSize", "5");
-			configurationOverrides.put("maxPoolSize", "20");
 			configurationOverrides.put("minPoolSize", "5");
-			configurationOverrides.put("maxStatements", "100");
+			/* NOTE: max pool size and max statements are related. 
+			 * If you increase max pool size, then also increase statements. */
+			configurationOverrides.put("maxPoolSize", "20");
+			configurationOverrides.put("maxStatements", "200");
 			configurationOverrides.put("maxStatementsPerConnection", "20");
 
 			SQLiteConfig config = new SQLiteConfig();
@@ -9477,9 +9479,11 @@ private final class PostgreSQLConnections extends ConnectionPool {
 			comboPooledDataSource.setPassword(password);
 			comboPooledDataSource.setAcquireIncrement(2);
 			comboPooledDataSource.setInitialPoolSize(5);
-			comboPooledDataSource.setMaxPoolSize(20);
 			comboPooledDataSource.setMinPoolSize(5);
-			comboPooledDataSource.setMaxStatements(100);
+			/* NOTE: max pool size and max statements are related. 
+			 * If you increase max pool size, then also increase statements. */
+			comboPooledDataSource.setMaxPoolSize(20);
+			comboPooledDataSource.setMaxStatements(200);
 			comboPooledDataSource.setMaxStatementsPerConnection(20);
 			setPooledDataSource(comboPooledDataSource);
 		}
-- 
GitLab