未验证 提交 7e247416 编写于 作者: X xiaoyu 提交者: GitHub

fix xa transaction get connection bug (#8181)

上级 6a255beb
......@@ -18,6 +18,7 @@
package org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource;
import com.google.common.base.Preconditions;
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.executor.sql.ConnectionMode;
import org.apache.shardingsphere.proxy.backend.communication.BackendDataSource;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
......@@ -59,7 +60,8 @@ public final class JDBCBackendDataSource implements BackendDataSource {
* @throws SQLException SQL exception
*/
public List<Connection> getConnections(final String schemaName, final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode) throws SQLException {
return getConnections(schemaName, dataSourceName, connectionSize, connectionMode, TransactionType.LOCAL);
TransactionType transactionType = TransactionType.valueOf(ProxyContext.getInstance().getMetaDataContexts().getProps().getValue(ConfigurationPropertyKey.PROXY_TRANSACTION_TYPE));
return getConnections(schemaName, dataSourceName, connectionSize, connectionMode, transactionType);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册