This is an automated email from the ASF dual-hosted git repository.

jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 48b7ad743c3 Remove ExecutorJDBCConnectionManager (#25491)
48b7ad743c3 is described below

commit 48b7ad743c3e53c578f570ef38b71e6a17adcc3e
Author: Liang Zhang <[email protected]>
AuthorDate: Sat May 6 16:58:47 2023 +0800

    Remove ExecutorJDBCConnectionManager (#25491)
---
 .../driver/jdbc/ExecutorJDBCConnectionManager.java | 28 ----------------------
 .../jdbc/core/connection/ConnectionManager.java    |  6 ++---
 .../proxy/backend/connector/BackendConnection.java |  4 ++--
 3 files changed, 5 insertions(+), 33 deletions(-)

diff --git 
a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/driver/jdbc/ExecutorJDBCConnectionManager.java
 
b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/driver/jdbc/ExecutorJDBCConnectionManager.java
deleted file mode 100644
index b9f8426176b..00000000000
--- 
a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/driver/jdbc/ExecutorJDBCConnectionManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc;
-
-import 
org.apache.shardingsphere.infra.executor.sql.prepare.driver.CacheableExecutorConnectionManager;
-
-import java.sql.Connection;
-
-/**
- * Executor JDBC connection manager.
- */
-public interface ExecutorJDBCConnectionManager extends 
CacheableExecutorConnectionManager<Connection> {
-}
diff --git 
a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/connection/ConnectionManager.java
 
b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/connection/ConnectionManager.java
index 381f48ac743..9ca75375ffb 100644
--- 
a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/connection/ConnectionManager.java
+++ 
b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/connection/ConnectionManager.java
@@ -31,7 +31,7 @@ import 
org.apache.shardingsphere.infra.datasource.pool.creator.DataSourcePoolCre
 import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties;
 import 
org.apache.shardingsphere.infra.exception.OverallConnectionNotEnoughException;
 import 
org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode;
-import 
org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.ExecutorJDBCConnectionManager;
+import 
org.apache.shardingsphere.infra.executor.sql.prepare.driver.CacheableExecutorConnectionManager;
 import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
 import org.apache.shardingsphere.infra.instance.metadata.InstanceType;
 import 
org.apache.shardingsphere.infra.instance.metadata.proxy.ProxyInstanceMetaData;
@@ -62,7 +62,7 @@ import java.util.Random;
 /**
  * Connection manager.
  */
-public final class ConnectionManager implements ExecutorJDBCConnectionManager, 
AutoCloseable {
+public final class ConnectionManager implements 
CacheableExecutorConnectionManager<Connection>, AutoCloseable {
     
     private final Map<String, DataSource> dataSourceMap = new 
LinkedHashMap<>();
     
@@ -156,7 +156,7 @@ public final class ConnectionManager implements 
ExecutorJDBCConnectionManager, A
     public void commit() throws SQLException {
         if (connectionTransaction.isLocalTransaction() && 
connectionTransaction.isRollbackOnly()) {
             forceExecuteTemplate.execute(cachedConnections.values(), 
Connection::rollback);
-        } else if (connectionTransaction.isLocalTransaction() && 
!connectionTransaction.isRollbackOnly()) {
+        } else if (connectionTransaction.isLocalTransaction()) {
             forceExecuteTemplate.execute(cachedConnections.values(), 
Connection::commit);
         } else {
             connectionTransaction.commit();
diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/BackendConnection.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/BackendConnection.java
index 4e08c9ad027..2c7e938a656 100644
--- 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/BackendConnection.java
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/BackendConnection.java
@@ -23,7 +23,7 @@ import com.google.common.collect.Multimap;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import 
org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode;
-import 
org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.ExecutorJDBCConnectionManager;
+import 
org.apache.shardingsphere.infra.executor.sql.prepare.driver.CacheableExecutorConnectionManager;
 import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
 import 
org.apache.shardingsphere.proxy.backend.connector.jdbc.connection.ConnectionPostProcessor;
 import 
org.apache.shardingsphere.proxy.backend.connector.jdbc.connection.ResourceLock;
@@ -51,7 +51,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
  */
 @RequiredArgsConstructor
 @Getter
-public final class BackendConnection implements ExecutorJDBCConnectionManager {
+public final class BackendConnection implements 
CacheableExecutorConnectionManager<Connection> {
     
     private final ConnectionSession connectionSession;
     

Reply via email to