From d2a8ea8cf4980acd2f9b474230bf9b6ded9f3480 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Thu, 1 Jun 2023 21:29:54 +0000 Subject: [PATCH] GUACAMOLE-1796: Reduce SQL Server batch size to ensure fetching large lists of connections still works. (cherry picked from commit 0cad9d38521a8fd4a1dafa321568d22da48939cd) --- .../auth/sqlserver/conf/SQLServerEnvironment.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/java/org/apache/guacamole/auth/sqlserver/conf/SQLServerEnvironment.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/java/org/apache/guacamole/auth/sqlserver/conf/SQLServerEnvironment.java index ba383131a..45e12ab1d 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/java/org/apache/guacamole/auth/sqlserver/conf/SQLServerEnvironment.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/java/org/apache/guacamole/auth/sqlserver/conf/SQLServerEnvironment.java @@ -89,15 +89,17 @@ public class SQLServerEnvironment extends JDBCEnvironment { public static final SQLServerDriver SQLSERVER_DEFAULT_DRIVER = SQLServerDriver.MICROSOFT_2005; /** - * The default maximum number of identifiers/parameters to be included in a + * The default maximum number of identifiers/parameters to be included in a * single batch when executing SQL statements for SQL Server. - * + * * SQL Server supports a maximum of 2100 parameters per query. A value of - * 1000 is chosen to stay within this limit and avoid query execution errors. + * 500 is chosen to stay within this limit and avoid query execution errors, + * as some queries involve multiple parameters per item - namely retrieval + * of connections. * * @see https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server */ - private static final int DEFAULT_BATCH_SIZE = 1000; + private static final int DEFAULT_BATCH_SIZE = 500; /** * Constructs a new SQLServerEnvironment, providing access to SQLServer-specific