From c2d56147891c52866a856c9a5851cf307be58576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 13 Dec 2024 17:46:16 +0100 Subject: [PATCH] chore: reset default to platform thread (#3551) Reset the default to using a platform thread for connections. This was the default before adding an option for setting the executor type, and the new default is causing problems with the async Connection API. Fixes #3541 --- .../com/google/cloud/spanner/connection/ConnectionImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java index 9f4a43d5a2e..2d7c917d230 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java @@ -292,7 +292,7 @@ static UnitOfWorkType of(TransactionMode transactionMode) { statementExecutorType = options.isUseVirtualThreads() ? StatementExecutorType.VIRTUAL_THREAD - : StatementExecutorType.DIRECT_EXECUTOR; + : StatementExecutorType.PLATFORM_THREAD; } this.statementExecutor = new StatementExecutor(statementExecutorType, options.getStatementExecutionInterceptors()); @@ -342,7 +342,7 @@ && getDialect() == Dialect.POSTGRESQL new StatementExecutor( options.isUseVirtualThreads() ? StatementExecutorType.VIRTUAL_THREAD - : StatementExecutorType.DIRECT_EXECUTOR, + : StatementExecutorType.PLATFORM_THREAD, Collections.emptyList()); this.spannerPool = Preconditions.checkNotNull(spannerPool); this.options = Preconditions.checkNotNull(options);