mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-926: Disable batch executor for SQL Server JDBC extension - it doesn't work.
This commit is contained in:
@@ -127,10 +127,11 @@ public class JDBCAuthenticationProviderModule extends MyBatisModule {
|
||||
// Transaction factory
|
||||
bindTransactionFactoryType(JdbcTransactionFactory.class);
|
||||
|
||||
// Set the JDBC Auth provider to use batch execution when possible
|
||||
bindConfigurationSetting(configuration -> {
|
||||
configuration.setDefaultExecutorType(ExecutorType.BATCH);
|
||||
});
|
||||
// Set the JDBC Auth provider to use batch execution if enabled
|
||||
if (environment.shouldUseBatchExecutor())
|
||||
bindConfigurationSetting(configuration -> {
|
||||
configuration.setDefaultExecutorType(ExecutorType.BATCH);
|
||||
});
|
||||
|
||||
// Add MyBatis mappers
|
||||
addMapperClass(ConnectionMapper.class);
|
||||
|
@@ -254,4 +254,22 @@ public abstract class JDBCEnvironment extends DelegatingEnvironment {
|
||||
*/
|
||||
public abstract boolean enforceAccessWindowsForActiveSessions() throws GuacamoleException;
|
||||
|
||||
/**
|
||||
* Returns true if the JDBC batch executor should be used by default, false
|
||||
* otherwise. The batch executor allows repeated updates to be batched
|
||||
* together for improved performance.
|
||||
* See https://mybatis.org/mybatis-3/java-api.html#sqlSessions
|
||||
*
|
||||
* @return
|
||||
* true if the batch executor should be used by default, false otherwise.
|
||||
*/
|
||||
public boolean shouldUseBatchExecutor() {
|
||||
|
||||
// Unless otherwise overwritten due to implementation-specific problems,
|
||||
// all JDBC extensions should use the batch executor if possible to
|
||||
// ensure the best performance for repetitive queries
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user