mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1253: Update select all queries to process in batches.
This commit is contained in:
committed by
Mike Jumper
parent
7e38a089cf
commit
2708a205d3
@@ -88,6 +88,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
|
||||
* 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.
|
||||
*
|
||||
* @see https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server
|
||||
*/
|
||||
private static final int DEFAULT_BATCH_SIZE = 1000;
|
||||
|
||||
/**
|
||||
* Constructs a new SQLServerEnvironment, providing access to SQLServer-specific
|
||||
* configuration options.
|
||||
@@ -117,6 +128,13 @@ public class SQLServerEnvironment extends JDBCEnvironment {
|
||||
DEFAULT_ABSOLUTE_MAX_CONNECTIONS
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBatchSize() throws GuacamoleException {
|
||||
return getProperty(SQLServerGuacamoleProperties.SQLSERVER_BATCH_SIZE,
|
||||
DEFAULT_BATCH_SIZE
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultMaxConnections() throws GuacamoleException {
|
||||
|
@@ -206,5 +206,17 @@ public class SQLServerGuacamoleProperties {
|
||||
public String getName() { return "sqlserver-auto-create-accounts"; }
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The maximum number of identifiers/parameters to be included in a single batch when
|
||||
* executing SQL statements.
|
||||
*/
|
||||
public static final IntegerGuacamoleProperty SQLSERVER_BATCH_SIZE =
|
||||
new IntegerGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "sqlserver-batch-size"; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user