From 9dcfa36e8cb8944929a92dca0924c6b07d44836f Mon Sep 17 00:00:00 2001 From: linghengqian Date: Fri, 27 Sep 2024 18:03:02 +0800 Subject: [PATCH] Bump the minimum Seata Client version for Seata integration to 2.1.0 to serve nativeTest under GraalVM Native Image --- .../graalvm-native-image/_index.cn.md | 47 +- .../graalvm-native-image/_index.en.md | 49 +- .../special-api/transaction/seata.cn.md | 88 +- .../special-api/transaction/seata.en.md | 97 ++- .../caffeine/2.9.3/reflect-config.json | 13 +- .../seata-all/2.1.0/proxy-config.json | 6 + .../seata-all/2.1.0/reflect-config.json | 814 ++++++++++++++++++ .../seata-all/2.1.0/resource-config.json | 20 + .../proxy-config.json | 8 +- .../reflect-config.json | 35 +- .../resource-config.json | 83 +- kernel/transaction/type/base/seata-at/pom.xml | 36 +- ...ataATShardingSphereTransactionManager.java | 32 +- .../base/seata/at/SeataTransactionHolder.java | 2 +- .../SeataTransactionalSQLExecutionHook.java | 2 +- ...TShardingSphereTransactionManagerTest.java | 36 +- ...eataTransactionalSQLExecutionHookTest.java | 2 +- .../seata/at/fixture/MockMessageHandler.java | 60 +- .../seata/at/fixture/MockSeataServer.java | 4 +- .../at/fixture/MockedMysqlDataSource.java | 131 +++ pom.xml | 2 +- test/native/pom.xml | 8 +- 22 files changed, 1256 insertions(+), 319 deletions(-) create mode 100644 infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/proxy-config.json create mode 100644 infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/reflect-config.json create mode 100644 infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/resource-config.json create mode 100644 kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockedMysqlDataSource.java diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md index a25a5f041a93a..de09536872249 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md @@ -258,46 +258,7 @@ Caused by: java.io.UnsupportedEncodingException: Codepage Cp1252 is not supporte ] ``` -6. 当使用 Seata 的 BASE 集成时,用户需要使用特定的 `io.seata:seata-all:1.8.0` 版本以避开对 ByteBuddy Java API 的使用, -并排除 `io.seata:seata-all:1.8.0` 中过时的 `org.antlr:antlr4-runtime:4.8` 的 Maven 依赖。可能的配置例子如下, - -```xml - - - - org.apache.shardingsphere - shardingsphere-jdbc - ${shardingsphere.version} - - - org.apache.shardingsphere - shardingsphere-transaction-base-seata-at - ${shardingsphere.version} - - - io.seata - seata-all - 1.8.0 - - - org.antlr - antlr4-runtime - - - commons-lang - commons-lang - - - org.apache.commons - commons-pool2 - - - - - -``` - -7. 当需要通过 ShardingSphere JDBC 使用 ClickHouse 方言时, +6. 当需要通过 ShardingSphere JDBC 使用 ClickHouse 方言时, 用户需要手动引入相关的可选模块和 classifier 为 `http` 的 ClickHouse JDBC 驱动。 原则上,ShardingSphere 的 GraalVM Native Image 集成不希望使用 classifier 为 `all` 的 `com.clickhouse:clickhouse-jdbc`, 因为 Uber Jar 会导致采集重复的 GraalVM Reachability Metadata。 @@ -482,8 +443,14 @@ CREATE TABLE IF NOT EXISTS t_order ) STORED BY ICEBERG STORED AS ORC TBLPROPERTIES ('format-version' = '2'); ``` +由于 HiveServer2 JDBC Driver 未实现 `java.sql.DatabaseMetaData#getURL()`, +ShardingSphere 做了模糊处理,因此用户暂时仅可通过 HikariCP 连接 HiveServer2。 + HiveServer2 不支持 ShardingSphere 集成级别的本地事务,XA 事务和 Seata AT 模式事务,更多讨论位于 https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions 。 +8. 由于 https://github.com/oracle/graal/issues/7979 的影响, +对应 `com.oracle.database.jdbc:ojdbc8` Maven 模块的 Oracle JDBC Driver 无法在 GraalVM Native Image 下使用。 + ## 贡献 GraalVM Reachability Metadata ShardingSphere 对在 GraalVM Native Image 下的可用性的验证,是通过 GraalVM Native Build Tools 的 Maven Plugin 子项目来完成的。 diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md index 67d1b20c47089..bdd9e7dca6723 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md @@ -271,48 +271,7 @@ to define the constructor of `com.mysql.cj.jdbc.MysqlXADataSource` inside the Gr ] ``` -6. When using Seata's BASE integration, -users need to use a specific `io.seata:seata-all:1.8.0` version to avoid using the ByteBuddy Java API, -and exclude the outdated Maven dependency of `org.antlr:antlr4-runtime:4.8` in `io.seata:seata-all:1.8.0`. -Possible configuration examples are as follows, - -```xml - - - - org.apache.shardingsphere - shardingsphere-jdbc - ${shardingsphere.version} - - - org.apache.shardingsphere - shardingsphere-transaction-base-seata-at - ${shardingsphere.version} - - - io.seata - seata-all - 1.8.0 - - - org.antlr - antlr4-runtime - - - commons-lang - commons-lang - - - org.apache.commons - commons-pool2 - - - - - -``` - -7. When using the ClickHouse dialect through ShardingSphere JDBC, +6. When using the ClickHouse dialect through ShardingSphere JDBC, users need to manually introduce the relevant optional modules and the ClickHouse JDBC driver with the classifier `http`. In principle, ShardingSphere's GraalVM Native Image integration does not want to use `com.clickhouse:clickhouse-jdbc` with classifier `all`, because Uber Jar will cause the collection of duplicate GraalVM Reachability Metadata. @@ -500,9 +459,15 @@ CREATE TABLE IF NOT EXISTS t_order ) STORED BY ICEBERG STORED AS ORC TBLPROPERTIES ('format-version' = '2'); ``` +Since HiveServer2 JDBC Driver does not implement `java.sql.DatabaseMetaData#getURL()`, +ShardingSphere has done some obfuscation, so users can only connect to HiveServer2 through HikariCP for now. + HiveServer2 does not support local transactions, XA transactions, and Seata AT mode transactions at the ShardingSphere integration level. More discussion is available at https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions . +8. Due to https://github.com/oracle/graal/issues/7979 , +the Oracle JDBC Driver corresponding to the `com.oracle.database.jdbc:ojdbc8` Maven module cannot be used under GraalVM Native Image. + ## Contribute GraalVM Reachability Metadata The verification of ShardingSphere's availability under GraalVM Native Image is completed through the Maven Plugin subproject diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.cn.md index a2458d8760bd2..ddf276a03bc9b 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.cn.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.cn.md @@ -9,7 +9,9 @@ Apache ShardingSphere 提供 BASE 事务,集成了 Seata 的实现。本文所 ## 前提条件 -引入 Maven 依赖,并排除 `io.seata:seata-all` 中过时的 `org.antlr:antlr4-runtime:4.8` 的 Maven 依赖。 +ShardingSphere 的 Seata 集成仅在 `apache/incubator-seata:v2.1.0` 或更高版本可用。 +对于 `org.apache.seata:seata-all` Maven 模块对应的 Seata Client,此限制同时作用于 HotSpot VM 和 GraalVM Native Image。 +引入 Maven 依赖,并排除 `org.apache.seata:seata-all` 中过时的 `org.antlr:antlr4-runtime:4.8` 的 Maven 依赖。 ```xml @@ -25,9 +27,9 @@ Apache ShardingSphere 提供 BASE 事务,集成了 Seata 的实现。本文所 ${shardingsphere.version} - io.seata + org.apache.seata seata-all - 2.0.0 + 2.1.0 org.antlr @@ -39,6 +41,12 @@ Apache ShardingSphere 提供 BASE 事务,集成了 Seata 的实现。本文所 ``` +受 Calcite 的影响,ShardingSphere JDBC 使用的 `commons-lang:commons-lang` 和 `org.apache.commons:commons-pool2` 与 Seata Client 存在依赖冲突, +需用户根据实际情景考虑是否需要解决依赖冲突。 + +使用 ShardingSphere 的 Seata 集成模块时,ShardingSphere 连接的数据库实例应同时实现 ShardingSphere 的方言解析支持与 Seata AT 模式的方言解析支持。 +这类数据库包括但不限于 `mysql`,`gvenzl/oracle-free`,`gvenzl/oracle-xe`,`postgres`,`mcr.microsoft.com/mssql/server` 等 Docker Image。 + ## 操作步骤 1. 启动 Seata Server @@ -50,32 +58,27 @@ Apache ShardingSphere 提供 BASE 事务,集成了 Seata 的实现。本文所 ### 启动 Seata Server 按照如下任一链接的步骤,下载并启动 Seata 服务器。 -合理的启动方式应通过 Docker Hub 中的 `seataio/seata-server` 的 Docker Image 来实例化 Seata 服务器。 -对于 `apache/incubator-seata:v2.0.0` 及更早的 Seata 版本,应使用 Docker Hub 中的 `seataio/seata-server`。 -否则应使用 Docker Hub 中的 `apache/seata-server`。 +合理的启动方式应通过 Docker Hub 中的 `apache/seata-server` 的 Docker Image 来实例化 Seata 服务器。 -- [seata-fescar-workshop](https://github.com/seata/fescar-workshop) -- https://hub.docker.com/r/seataio/seata-server - https://hub.docker.com/r/apache/seata-server ### 创建 undo_log 表 在每一个 ShardingSphere 涉及的真实数据库实例中创建 `undo_log` 表。 -SQL 的内容以 https://github.com/apache/incubator-seata/tree/v2.0.0/script/client/at/db 内对应的数据库为准。 +SQL 的内容以 https://github.com/apache/incubator-seata/tree/v2.1.0/script/client/at/db 内对应的数据库为准。 以下内容以 MySQL 为例。 ```sql CREATE TABLE IF NOT EXISTS `undo_log` ( - `branch_id` BIGINT NOT NULL COMMENT 'branch transaction id', - `xid` VARCHAR(128) NOT NULL COMMENT 'global transaction id', - `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization', - `rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info', - `log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status', - `log_created` DATETIME(6) NOT NULL COMMENT 'create datetime', - `log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime', - UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`) - ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT ='AT transaction mode undo table'; - + `branch_id` BIGINT NOT NULL COMMENT 'branch transaction id', + `xid` VARCHAR(128) NOT NULL COMMENT 'global transaction id', + `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization', + `rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info', + `log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status', + `log_created` DATETIME(6) NOT NULL COMMENT 'create datetime', + `log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime', + UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`) + ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT ='AT transaction mode undo table'; ALTER TABLE `undo_log` ADD INDEX `ix_log_created` (`log_created`); ``` @@ -91,7 +94,7 @@ transaction: ``` 在 classpath 的根目录中增加 `seata.conf` 文件, -配置文件格式参考 `io.seata.config.FileConfiguration` 的 [JavaDoc](https://github.com/apache/incubator-seata/blob/v2.0.0/config/seata-config-core/src/main/java/io/seata/config/FileConfiguration.java)。 +配置文件格式参考 `org.apache.seata.config.FileConfiguration` 的 [JavaDoc](https://github.com/apache/incubator-seata/blob/v2.1.0/config/seata-config-core/src/main/java/org/apache/seata/config/FileConfiguration.java)。 `seata.conf` 存在四个属性, @@ -116,8 +119,8 @@ client { 一个最小配置的 `seata.conf` 如下。 由 ShardingSphere 管理的 `seata.conf` 中, `client.transaction.service.group` 的默认值设置为 `default` 是出于历史原因。 假设用户使用的 Seata Server 和 Seata Client 的 `registry.conf` 中,`registry.type` 和 `config.type` 均为 `file`, -则对于 `registry.conf` 的 `config.file.name` 配置的 `.conf` 文件中,事务分组名在 `apache/incubator-seata:v1.5.1` 之后默认值为 `default_tx_group`, -反之则为 `my_test_tx_group`。 +则对于 `registry.conf` 的 `config.file.name` 配置的 `.conf` 文件中,事务分组名在 `apache/incubator-seata:v1.5.1` 及之后默认值为 `default_tx_group`, +在 `apache/incubator-seata:v1.5.1` 之前则为 `my_test_tx_group`。 ```conf client.application.id = example @@ -131,7 +134,7 @@ ShardingSphere 的 Seata 集成不支持隔离级别。 ShardingSphere 的 Seata 集成将获取到的 Seata 全局事务置入线程的局部变量。 而 `org.apache.seata.spring.annotation.GlobalTransactionScanner` 则是采用 Dynamic Proxy 的方式对方法进行增强。 -这意味着用户在使用 ShardingSphere 的 Seata 集成时,用户应避免使用 `io.seata:seata-all` 的 Java API, +这意味着用户在使用 ShardingSphere 的 Seata 集成时,用户应避免使用 `org.apache.seata:seata-all` 的 Java API, 除非用户正在混合使用 ShardingSphere 的 Seata 集成与 Seata Client 的 TCC 模式特性。 针对 ShardingSphere 数据源,讨论 6 种情况, @@ -145,13 +148,13 @@ ShardingSphere 的 Seata 集成将获取到的 Seata 全局事务置入线程的 4. 在函数上使用 Spring Framework 的 `org.springframework.transaction.annotation.Transactional` 注解,这是被允许的。 -5. 在函数上使用 `io.seata.spring.annotation.GlobalTransactional` 注解,这是**不被允许的**。 +5. 在函数上使用 `org.apache.seata.spring.annotation.GlobalTransactional` 注解,这是**不被允许的**。 -6. 手动从 `io.seata.tm.api.GlobalTransactionContext ` 创建 `io.seata.tm.api.GlobalTransaction` 实例, -调用 `io.seata.tm.api.GlobalTransaction` 实例的 `begin()`, `commit()` 和 `rollback()` 方法,这是**不被允许的**。 +6. 手动从 `org.apache.seata.tm.api.GlobalTransactionContext ` 创建 `org.apache.seata.tm.api.GlobalTransaction` 实例, +调用 `org.apache.seata.tm.api.GlobalTransaction` 实例的 `begin()`, `commit()` 和 `rollback()` 方法,这是**不被允许的**。 在使用 Spring Boot 的实际情景中, -`com.alibaba.cloud:spring-cloud-starter-alibaba-seata` 和 `io.seata:seata-spring-boot-starter` 常常被其他 Maven 依赖传递引入。 +`com.alibaba.cloud:spring-cloud-starter-alibaba-seata` 和 `org.apache.seata:seata-spring-boot-starter` 常常被其他 Maven 依赖传递引入。 为了避开事务冲突,用户需要在 Spring Boot 的配置文件中将 `seata.enable-auto-data-source-proxy` 的属性置为 `false`。一个可能的依赖关系如下。 ```xml @@ -168,9 +171,9 @@ ShardingSphere 的 Seata 集成将获取到的 Seata 全局事务置入线程的 ${shardingsphere.version} - io.seata + org.apache.seata seata-spring-boot-starter - 2.0.0 + 2.1.0 org.antlr @@ -195,20 +198,20 @@ seata: 对于设置开启 ShardingSphere 的 Seata 集成的情况下, 在与 ShardingSphere JDBC DataSource 无关的业务函数中,如需在业务函数使用 Seata Client 的 Seata TCC 模式相关的特性, -可实例化一个未代理的普通 TCC 接口实现类, 然后使用 `io.seata.integration.tx.api.util.ProxyUtil` 创建一个代理的TCC接口类, +可实例化一个未代理的普通 TCC 接口实现类, 然后使用 `org.apache.seata.integration.tx.api.util.ProxyUtil` 创建一个代理的TCC接口类, 并调用 TCC 接口实现类 `Try`,`Confirm`,`Cancel` 三个阶段对应的函数。 -对于由 Seata TCC 模式而引入的 `io.seata.spring.annotation.GlobalTransactional` 注解或 Seata TCC 模式涉及的业务函数中需要与数据库实例交互, +对于由 Seata TCC 模式而引入的 `org.apache.seata.spring.annotation.GlobalTransactional` 注解或 Seata TCC 模式涉及的业务函数中需要与数据库实例交互, 此注解标记的业务函数内不应使用 ShardingSphere JDBC DataSource, 而是应该手动创建`javax.sql.DataSource` 实例,或从自定义的 Spring Bean 中获取 `javax.sql.DataSource` 实例。 ### 跨服务调用的事务传播 跨服务调用场景下的事务传播,并不像单个微服务内的事务操作一样开箱即用。 -对于 Seata Server,跨服务调用场景下的事务传播,要把 XID 通过服务调用传递到服务提供方,并绑定到 `io.seata.core.context.RootContext` 中去。 +对于 Seata Server,跨服务调用场景下的事务传播,要把 XID 通过服务调用传递到服务提供方,并绑定到 `org.apache.seata.core.context.RootContext` 中去。 参考 https://seata.apache.org/docs/user/api/ 。这需要讨论两种情况, -1. 在使用 ShardingSphere JDBC 的场景下,跨多个微服务的事务场景需要考虑在起点微服务的上下文使用 `io.seata.core.context.RootContext.getXID()` 获取 Seata XID 后, +1. 在使用 ShardingSphere JDBC 的场景下,跨多个微服务的事务场景需要考虑在起点微服务的上下文使用 `org.apache.seata.core.context.RootContext.getXID()` 获取 Seata XID 后, 通过 HTTP 或 RPC 等手段传递给终点微服务,并在终点微服务的 Filter 或 Spring WebMVC HandlerInterceptor 中处理。 Spring WebMVC HandlerInterceptor 仅适用于 Spring Boot 微服务,对 Quarkus,Micronaut Framework 和 Helidon 无效。 @@ -270,7 +273,7 @@ public class DemoService { 讨论单服务调用的事务传播。当微服务实例 `a-service` 的业务函数 `aMethod` 抛出异常,在业务函数内对 MySQL 数据库实例 `a-mysql` 的更改将被正常回滚。 讨论跨服务调用的事务传播。当微服务实例 `b-service` 的业务函数 `bMethod` 抛出异常,在业务函数内对 MySQL 数据库实例 `b-mysql` 的更改将被正常回滚, -而微服务实例 `a-service` 的 `io.seata.core.context.RootContext` 未绑定微服务实例 `b-service` 的业务函数 `bMethod` 的 Seata XID, +而微服务实例 `a-service` 的 `org.apache.seata.core.context.RootContext` 未绑定微服务实例 `b-service` 的业务函数 `bMethod` 的 Seata XID, 因此在业务函数内对 MySQL 数据库实例 `a-mysql` 的更改将不会被回滚。 为了实现当微服务实例 `b-service` 的业务函数 `bMethod` 抛出异常,在业务函数内对 MySQL 数据库实例 `a-mysql` 和 `b-mysql` 的更改均被正常回滚, @@ -281,7 +284,7 @@ public class DemoService { 可能的改造逻辑如下。 ```java -import io.seata.core.context.RootContext; +import org.apache.seata.core.context.RootContext; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -308,7 +311,7 @@ public class DemoService { 此时在微服务实例 `a-service` 和 `b-service` 均需要添加自定义的 `org.springframework.web.servlet.config.annotation.WebMvcConfigurer` 实现。 ```java -import io.seata.integration.http.TransactionPropagationInterceptor; +import org.apache.seata.integration.http.TransactionPropagationInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -330,7 +333,7 @@ public class CustomWebMvcConfigurer implements WebMvcConfigurer { 可能的改造逻辑如下。 ```java -import io.seata.core.context.RootContext; +import org.apache.seata.core.context.RootContext; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestClient; @@ -356,7 +359,7 @@ public class DemoService { 此时在微服务实例 `a-service` 和 `b-service` 均需要添加自定义的 `org.springframework.web.servlet.config.annotation.WebMvcConfigurer` 实现。 ```java -import io.seata.integration.http.JakartaTransactionPropagationInterceptor; +import org.apache.seata.integration.http.JakartaTransactionPropagationInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -375,14 +378,14 @@ public class CustomWebMvcConfigurer implements WebMvcConfigurer { 3. 微服务实例 `a-service` 和 `b-service` 均为 Spring Boot 微服务,但使用的 API 网关中间件阻断了所有包含 `TX_XID` 的 HTTP Header 的 HTTP 请求。 用户需要考虑更改把 XID 通过服务调用传递到微服务实例 `a-service` 使用的 HTTP Header,或使用 RPC 框架把 XID 通过服务调用传递到微服务实例 `a-service`。 -参考 https://github.com/apache/incubator-seata/tree/v2.0.0/integration 。 +参考 https://github.com/apache/incubator-seata/tree/v2.1.0/integration 。 4. 微服务实例 `a-service` 和 `b-service` 均为 Quarkus,Micronaut Framework 和 Helidon 等微服务。此情况下无法使用 Spring WebMVC HandlerInterceptor。 可参考如下 Spring Boot 3 的自定义 WebMvcConfigurer 实现,来实现 Filter。 ```java -import io.seata.common.util.StringUtils; -import io.seata.core.context.RootContext; +import org.apache.seata.common.util.StringUtils; +import org.apache.seata.core.context.RootContext; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.springframework.context.annotation.Configuration; @@ -429,6 +432,3 @@ public class CustomWebMvcConfigurer implements WebMvcConfigurer { 5. 微服务实例 `a-service` 和 `b-service` 均为 Spring Boot 微服务,但使用的组件是 Spring WebFlux 而非 Spring WebMVC。 在反应式编程 API 下 ShardingSphere JDBC 无法处理 R2DBC DataSource,仅可处理 JDBC DataSource。 在使用 WebFlux 组件的 Spring Boot 微服务中应避免创建 ShardingSphere JDBC DataSource。 - -6. 微服务实例 `a-service` 和 `b-service` 使用的 Seata Client 为 `org.apache.seata:seata-all`, 而非 `io.seata:seata-all`。 -将所有对 `io.seata` package 的调用更改为 `org.apache.seata` package 即可。 diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.en.md index 2406599524368..37b7f9410bc0a 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.en.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/special-api/transaction/seata.en.md @@ -10,7 +10,9 @@ All references to Seata integration in this article refer to Seata AT mode. ## Prerequisites -Introduce Maven dependencies and exclude the outdated Maven dependencies of `org.antlr:antlr4-runtime:4.8` in `io.seata:seata-all`. +ShardingSphere's Seata integration is only available in `apache/incubator-seata:v2.1.0` or higher. +For Seata Client corresponding to the `org.apache.seata:seata-all` Maven module, this limitation applies to both HotSpot VM and GraalVM Native Image. +Introduce Maven dependencies and exclude the outdated Maven dependency of `org.antlr:antlr4-runtime:4.8` in `org.apache.seata:seata-all`. ```xml @@ -26,20 +28,28 @@ Introduce Maven dependencies and exclude the outdated Maven dependencies of `org ${shardingsphere.version} - io.seata - seata-all - 2.0.0 - + org.apache.seata + seata-all + 2.1.0 + org.antlr antlr4-runtime - + ``` +Affected by Calcite, +`commons-lang:commons-lang` and `org.apache.commons:commons-pool2` used by ShardingSphere JDBC have dependency conflicts with Seata Client. +Users need to consider whether to resolve dependency conflicts based on actual scenarios. + +When using ShardingSphere's Seata integration module, +the database instance connected to ShardingSphere should implement both ShardingSphere's dialect parsing support and Seata AT mode's dialect parsing support. +Such databases include but are not limited to `mysql`, `gvenzl/oracle-free`, `gvenzl/oracle-xe`, `postgres`, `mcr.microsoft.com/mssql/server` and other Docker Images. + ## Procedure 1. Start Seata Server @@ -52,32 +62,27 @@ Introduce Maven dependencies and exclude the outdated Maven dependencies of `org Follow the steps in one of the links below to download and start Seata Server. -The proper way to start Seata Server is to instantiate it through the Docker Image of `seataio/seata-server` in Docker Hub. -For `apache/incubator-seata:v2.0.0` and earlier Seata versions, `seataio/seata-server` from Docker Hub should be used. -Otherwise, `apache/seata-server` from Docker Hub should be used. +The proper way to start Seata Server is to instantiate it through the Docker Image of `apache/seata-server` in Docker Hub. -- [seata-fescar-workshop](https://github.com/seata/fescar-workshop) -- https://hub.docker.com/r/seataio/seata-server - https://hub.docker.com/r/apache/seata-server ### Create undo_log table Create the `undo_log` table in each real database instance involved in ShardingSphere. -The SQL content is based on the corresponding database in https://github.com/apache/incubator-seata/tree/v2.0.0/script/client/at/db . +The SQL content is based on the corresponding database in https://github.com/apache/incubator-seata/tree/v2.1.0/script/client/at/db . The following content takes MySQL as an example. ```sql CREATE TABLE IF NOT EXISTS `undo_log` ( - `branch_id` BIGINT NOT NULL COMMENT 'branch transaction id', - `xid` VARCHAR(128) NOT NULL COMMENT 'global transaction id', - `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization', - `rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info', - `log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status', - `log_created` DATETIME(6) NOT NULL COMMENT 'create datetime', - `log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime', - UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`) - ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT ='AT transaction mode undo table'; - + `branch_id` BIGINT NOT NULL COMMENT 'branch transaction id', + `xid` VARCHAR(128) NOT NULL COMMENT 'global transaction id', + `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization', + `rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info', + `log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status', + `log_created` DATETIME(6) NOT NULL COMMENT 'create datetime', + `log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime', + UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`) + ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT ='AT transaction mode undo table'; ALTER TABLE `undo_log` ADD INDEX `ix_log_created` (`log_created`); ``` @@ -96,7 +101,7 @@ transaction: ``` Add the `seata.conf` file to the root directory of the classpath. -The configuration file format refers to the [JavaDoc](https://github.com/apache/incubator-seata/blob/v2.0.0/config/seata-config-core/src/main/java/io/seata/config/FileConfiguration.java) of `io.seata.config.FileConfiguration`. +The configuration file format refers to the [JavaDoc](https://github.com/apache/incubator-seata/blob/v2.1.0/config/seata-config-core/src/main/java/org/apache/seata/config/FileConfiguration.java) of `org.apache.seata.config.FileConfiguration`. There are four properties in `seata.conf`, @@ -121,8 +126,9 @@ client { A minimally configured `seata.conf` is as follows. In `seata.conf` managed by ShardingSphere, the default value of `client.transaction.service.group` is set to `default` for historical reasons. Assuming that in the `registry.conf` of Seata Server and Seata Client used by the user, `registry.type` and `config.type` are both `file`, -then for the `.conf` file configured by `config.file.name` of `registry.conf`, -the default value of the transaction group name is `default_tx_group` after `apache/incubator-seata:v1.5.1`, otherwise it is `my_test_tx_group`. +then for the `.conf` file configured by `config.file.name` of `registry.conf`, +the default transaction group name is `default_tx_group` in `apache/incubator-seata:v1.5.1` and later, +and `my_test_tx_group` before `apache/incubator-seata:v1.5.1`. ```conf client.application.id = example @@ -136,7 +142,7 @@ ShardingSphere's Seata integration does not support isolation levels. ShardingSphere's Seata integration places the obtained Seata global transaction into the thread's local variables. And `org.apache.seata.spring.annotation.GlobalTransactionScanner` uses Dynamic Proxy to enhance the method. -This means that when using ShardingSphere's Seata integration, users should avoid using the Java API of `io.seata:seata-all`, +This means that when using ShardingSphere's Seata integration, users should avoid using the Java API of `org.apache.seata:seata-all`, unless the user is mixing ShardingSphere's Seata integration with the TCC mode feature of Seata Client. For ShardingSphere data source, discuss 6 situations, @@ -150,13 +156,13 @@ and manually calling the `setAutoCommit()`, `commit()` and `rollback()` methods 4. Using Spring Framework’s `org.springframework.transaction.annotation.Transactional` annotation on functions is allowed. -5. Using the `io.seata.spring.annotation.GlobalTransactional` annotation on the function is **not allowed**. +5. Using the `org.apache.seata.spring.annotation.GlobalTransactional` annotation on the function is **not allowed**. -6. Manually create `io.seata.tm.api.GlobalTransaction` instance from `io.seata.tm.api.GlobalTransactionContext`, -calling the `begin()`, `commit()` and `rollback()` methods of an `io.seata.tm.api.GlobalTransaction` instance is **not allowed**. +6. Manually create `org.apache.seata.tm.api.GlobalTransaction` instance from `org.apache.seata.tm.api.GlobalTransactionContext`, +calling the `begin()`, `commit()` and `rollback()` methods of an `org.apache.seata.tm.api.GlobalTransaction` instance is **not allowed**. In actual scenarios where Spring Boot is used, -`com.alibaba.cloud:spring-cloud-starter-alibaba-seata` and `io.seata:seata-spring-boot-starter` are often transitively imported by other Maven dependencies. +`com.alibaba.cloud:spring-cloud-starter-alibaba-seata` and `org.apache.seata:seata-spring-boot-starter` are often transitively imported by other Maven dependencies. To avoid transaction conflicts, users need to set the property `seata.enable-auto-data-source-proxy` to `false` in the Spring Boot configuration file. A possible dependency relationship is as follows. @@ -174,9 +180,9 @@ A possible dependency relationship is as follows. ${shardingsphere.version} - io.seata + org.apache.seata seata-spring-boot-starter - 2.0.0 + 2.1.0 org.antlr @@ -202,21 +208,21 @@ seata: For the case of setting up ShardingSphere's Seata integration, In business functions unrelated to ShardingSphere JDBC DataSource, if you need to use Seata Client's Seata TCC mode-related features in business functions, -you can instantiate a non-proxy ordinary TCC interface implementation class, and then use `io.seata.integration.tx.api.util.ProxyUtil` to create a proxy TCC interface class, +you can instantiate a non-proxy ordinary TCC interface implementation class, and then use `org.apache.integration.tx.api.util.ProxyUtil` to create a proxy TCC interface class, and call the functions corresponding to the three stages of the TCC interface implementation class `Try`, `Confirm`, and `Cancel`. -For the `io.seata.spring.annotation.GlobalTransactional` annotation introduced by the Seata TCC mode or the business functions involved in the Seata TCC mode that need to interact with the database instance, +For the `org.apache.seata.spring.annotation.GlobalTransactional` annotation introduced by the Seata TCC mode or the business functions involved in the Seata TCC mode that need to interact with the database instance, ShardingSphere JDBC DataSource should not be used in the business functions marked by this annotation. Instead, a `javax.sql.DataSource` instance should be created manually or obtained from a custom Spring Bean. ### Transactional propagation across service calls Transactional propagationn in cross-service call scenarios is not as out-of-the-box as transaction operations within a single microservice. -For Seata Server, transactional propagation in cross-service call scenarios requires passing XID to the service provider through service calls and binding it to `io.seata.core.context.RootContext`. +For Seata Server, transactional propagation in cross-service call scenarios requires passing XID to the service provider through service calls and binding it to `org.apache.seata.core.context.RootContext`. Refer to https://seata.apache.org/docs/user/api/ . This requires discussing two situations, 1. In the scenario of using ShardingSphere JDBC, -transaction scenarios across multiple microservices need to consider using `io.seata.core.context.RootContext.getXID()` to obtain Seata XID in the context of the starting microservice, +transaction scenarios across multiple microservices need to consider using `org.apache.seata.core.context.RootContext.getXID()` to obtain Seata XID in the context of the starting microservice, and passing it to the end microservice through HTTP or RPC, and processing it in the Filter or Spring WebMVC HandlerInterceptor of the end microservice. Spring WebMVC HandlerInterceptor is only applicable to Spring Boot microservices and is invalid for Quarkus, Micronaut Framework and Helidon. @@ -285,7 +291,7 @@ the changes to the MySQL database instance `a-mysql` in the business function wi Discuss transaction propagation for cross-service calls. When the business function `bMethod` of the microservice instance `b-service` throws an exception, the changes to the MySQL database instance `b-mysql` in the business function will be rolled back normally, -and the `io.seata.core.context.RootContext` of the microservice instance `a-service` is not bound to the Seata XID of the business function `bMethod` of the microservice instance `b-service`, +and the `org.apache.seata.core.context.RootContext` of the microservice instance `a-service` is not bound to the Seata XID of the business function `bMethod` of the microservice instance `b-service`, so the changes to the MySQL database instance `a-mysql` in the business function will not be rolled back. In order to achieve that when the business function `bMethod` of the microservice instance `b-service` throws an exception, @@ -297,7 +303,7 @@ Users can use `org.springframework.web.client.RestTemplate` in the business func The possible transformation logic is as follows. ```java -import io.seata.core.context.RootContext; +import org.apache.seata.core.context.RootContext; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -324,7 +330,7 @@ public class DemoService { At this time, custom `org.springframework.web.servlet.config.annotation.WebMvcConfigurer` implementations need to be added to the microservice instances `a-service` and `b-service`. ```java -import io.seata.integration.http.TransactionPropagationInterceptor; +import org.apache.seata.integration.http.TransactionPropagationInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -347,7 +353,7 @@ Users can use `org.springframework.web.client.RestClient` in the business functi The possible transformation logic is as follows. ```java -import io.seata.core.context.RootContext; +import org.apache.seata.core.context.RootContext; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestClient; @@ -373,7 +379,7 @@ public class DemoService { At this time, custom `org.springframework.web.servlet.config.annotation.WebMvcConfigurer` implementations need to be added to the microservice instances `a-service` and `b-service`. ```java -import io.seata.integration.http.JakartaTransactionPropagationInterceptor; +import org.apache.seata.integration.http.JakartaTransactionPropagationInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -395,15 +401,15 @@ the changes to the MySQL database instances `a-mysql` and `b-mysql` in the busin but the API gateway middleware used blocks all HTTP requests containing the HTTP Header of `TX_XID`. The user needs to consider changing the HTTP Header used to pass XID to the microservice instance `a-service` through service calls, or use the RPC framework to pass XID to the microservice instance `a-service` through service calls. -Refer to https://github.com/apache/incubator-seata/tree/v2.0.0/integration . +Refer to https://github.com/apache/incubator-seata/tree/v2.1.0/integration . 4. The microservice instances `a-service` and `b-service` are both microservices such as Quarkus, Micronaut Framework and Helidon. In this case, Spring WebMVC HandlerInterceptor cannot be used. You can refer to the following Spring Boot 3 custom WebMvcConfigurer implementation to implement Filter. ```java -import io.seata.common.util.StringUtils; -import io.seata.core.context.RootContext; +import org.apache.seata.common.util.StringUtils; +import org.apache.seata.core.context.RootContext; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.springframework.context.annotation.Configuration; @@ -450,6 +456,3 @@ public class CustomWebMvcConfigurer implements WebMvcConfigurer { 5. Both microservice instances `a-service` and `b-service` are Spring Boot microservices, but the components used are Spring WebFlux instead of Spring WebMVC. ShardingSphere JDBC cannot handle R2DBC DataSource under the reactive programming API, only JDBC DataSource. Avoid creating ShardingSphere JDBC DataSource in Spring Boot microservices using WebFlux components. - -6. The Seata Client used by the microservice instances `a-service` and `b-service` is `org.apache.seata:seata-all`, not `io.seata:seata-all`. -Change all calls to the `io.seata` package to the `org.apache.seata` package. diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/com.github.ben-manes.caffeine/caffeine/2.9.3/reflect-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/com.github.ben-manes.caffeine/caffeine/2.9.3/reflect-config.json index a1ddeefde563b..1881bc29d4735 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/com.github.ben-manes.caffeine/caffeine/2.9.3/reflect-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/com.github.ben-manes.caffeine/caffeine/2.9.3/reflect-config.json @@ -99,19 +99,16 @@ "name":"com.github.benmanes.caffeine.cache.StripedBuffer", "fields":[{"name":"tableBusy"}] }, +{ + "condition":{"typeReachable":"com.github.benmanes.caffeine.cache.NodeFactory"}, + "name":"com.github.benmanes.caffeine.cache.PDWMS", + "methods":[{"name":"","parameterTypes":[] }] +}, { "condition":{"typeReachable":"com.github.benmanes.caffeine.cache.StripedBuffer"}, "name":"java.lang.Thread", "fields":[{"name":"threadLocalRandomProbe"}] }, -{ - "condition":{"typeReachable":"com.github.benmanes.caffeine.cache.LocalLoadingCache"}, - "name":"org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader" -}, -{ - "condition":{"typeReachable":"com.github.benmanes.caffeine.cache.LocalLoadingCache"}, - "name":"org.apache.shardingsphere.sql.parser.core.database.cache.ParseTreeCacheLoader" -}, { "condition":{"typeReachable":"com.github.benmanes.caffeine.cache.UnsafeAccess"}, "name":"sun.misc.Unsafe", diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/proxy-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/proxy-config.json new file mode 100644 index 0000000000000..622a60d0acc7f --- /dev/null +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/proxy-config.json @@ -0,0 +1,6 @@ +[ + { + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationCache"}, + "interfaces":["org.apache.seata.config.Configuration"] + } +] diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/reflect-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/reflect-config.json new file mode 100644 index 0000000000000..e3264318f6982 --- /dev/null +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/reflect-config.json @@ -0,0 +1,814 @@ +[ +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"[Lcom.fasterxml.jackson.databind.deser.Deserializers;" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"[Lcom.fasterxml.jackson.databind.ser.Serializers;" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.DataSourceProxy"}, + "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.AbstractUndoLogManager"}, + "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"io.seata.config.ConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"io.seata.config.ExtConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.rpc.netty.TmNettyRemotingClient"}, + "name":"io.seata.core.auth.AuthSigner" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.context.ContextCoreLoader$ContextCoreHolder"}, + "name":"io.seata.core.context.ContextCore" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultResourceManager"}, + "name":"io.seata.core.model.ResourceManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.tm.TransactionManagerHolder$SingletonHolder"}, + "name":"io.seata.core.model.TransactionManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.rpc.netty.AbstractNettyRemoting"}, + "name":"io.seata.core.rpc.hook.RpcHook" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.serializer.SerializerServiceLoader"}, + "name":"io.seata.core.serializer.Serializer" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"io.seata.discovery.registry.RegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultRMHandler"}, + "name":"io.seata.rm.AbstractRMHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"io.seata.rm.datasource.undo.UndoExecutorHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"io.seata.rm.datasource.undo.UndoLogManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogParserFactory"}, + "name":"io.seata.rm.datasource.undo.UndoLogParser" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"io.seata.rm.datasource.undo.parser.spi.JacksonSerializer" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultResourceManager"}, + "name":"io.seata.rm.tcc.TCCResourceManager", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultResourceManager"}, + "name":"io.seata.saga.rm.SagaResourceManager", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"io.seata.sqlparser.EscapeHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.SQLVisitorFactory"}, + "name":"io.seata.sqlparser.SQLRecognizerFactory" +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"io.seata.sqlparser.druid.SQLOperateRecognizerHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"io.seata.sqlparser.struct.TableMetaCache" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.util.JdbcUtils"}, + "name":"io.seata.sqlparser.util.DbTypeParser" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationCache"}, + "name":"org.apache.seata.config.Configuration" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationCache$$Lambda/0x00007f3e4ba49308"}, + "name":"org.apache.seata.config.Configuration" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"org.apache.seata.config.apollo.ApolloConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"org.apache.seata.config.consul.ConsulConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"org.apache.seata.config.custom.CustomConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"org.apache.seata.config.etcd3.EtcdConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.FileConfigFactory"}, + "name":"org.apache.seata.config.file.SimpleFileConfig", + "methods":[{"name":"","parameterTypes":["java.io.File","java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"org.apache.seata.config.nacos.NacosConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"org.apache.seata.config.springcloud.SpringCloudConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "name":"org.apache.seata.config.zk.ZookeeperConfigurationProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.rpc.netty.TmNettyRemotingClient"}, + "name":"org.apache.seata.core.auth.DefaultAuthSigner", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.context.ContextCoreLoader$ContextCoreHolder"}, + "name":"org.apache.seata.core.context.FastThreadLocalContextCore", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.context.ContextCoreLoader$ContextCoreHolder"}, + "name":"org.apache.seata.core.context.ThreadLocalContextCore" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.rpc.netty.AbstractNettyRemoting"}, + "name":"org.apache.seata.core.rpc.hook.StatusRpcHook", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.rpc.netty.NettyClientBootstrap"}, + "name":"org.apache.seata.core.rpc.netty.AbstractNettyRemotingClient$ClientHandler", + "methods":[{"name":"channelInactive","parameterTypes":["io.netty.channel.ChannelHandlerContext"] }, {"name":"channelRead","parameterTypes":["io.netty.channel.ChannelHandlerContext","java.lang.Object"] }, {"name":"channelWritabilityChanged","parameterTypes":["io.netty.channel.ChannelHandlerContext"] }, {"name":"close","parameterTypes":["io.netty.channel.ChannelHandlerContext","io.netty.channel.ChannelPromise"] }, {"name":"exceptionCaught","parameterTypes":["io.netty.channel.ChannelHandlerContext","java.lang.Throwable"] }, {"name":"userEventTriggered","parameterTypes":["io.netty.channel.ChannelHandlerContext","java.lang.Object"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.rpc.netty.NettyClientBootstrap$1"}, + "name":"org.apache.seata.core.rpc.netty.v1.ProtocolV1Decoder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.rpc.netty.NettyClientBootstrap$1"}, + "name":"org.apache.seata.core.rpc.netty.v1.ProtocolV1Encoder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.FileRegistryProvider", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.consul.ConsulRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.custom.CustomRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.etcd3.EtcdRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.eureka.EurekaRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.nacos.NacosRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.raft.RaftRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.redis.RedisRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.sofa.SofaRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.discovery.registry.RegistryFactory"}, + "name":"org.apache.seata.discovery.registry.zk.ZookeeperRegistryProvider" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultRMHandler"}, + "name":"org.apache.seata.rm.RMHandlerAT", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultRMHandler"}, + "name":"org.apache.seata.rm.RMHandlerXA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultResourceManager"}, + "name":"org.apache.seata.rm.datasource.DataSourceManager", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.StatementProxy"}, + "name":"org.apache.seata.rm.datasource.exec.postgresql.PostgresqlInsertExecutor", + "methods":[{"name":"","parameterTypes":["org.apache.seata.rm.datasource.StatementProxy","org.apache.seata.rm.datasource.exec.StatementCallback","org.apache.seata.sqlparser.SQLRecognizer"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"org.apache.seata.rm.datasource.sql.handler.dm.DmEscapeHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"org.apache.seata.rm.datasource.sql.handler.mariadb.MariadbEscapeHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"org.apache.seata.rm.datasource.sql.handler.mysql.MySQLEscapeHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"org.apache.seata.rm.datasource.sql.handler.oracle.OracleEscapeHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"org.apache.seata.rm.datasource.sql.handler.polardbx.PolarDBXEscapeHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"org.apache.seata.rm.datasource.sql.handler.postgresql.PostgresqlEscapeHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.EscapeHandlerFactory"}, + "name":"org.apache.seata.rm.datasource.sql.handler.sqlserver.SqlServerEscapeHandler" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$$Lambda/0x00007f3e4bc2af00"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.StatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field", + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$$Lambda/0x00007f3e4bc17788"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.BaseTransactionalExecutor"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.ExecuteTemplate"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.AbstractUndoLogManager"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Field", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"getKeyType","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }, {"name":"getValue","parameterTypes":[] }, {"name":"setKeyType","parameterTypes":["org.apache.seata.rm.datasource.sql.struct.KeyType"] }, {"name":"setName","parameterTypes":["java.lang.String"] }, {"name":"setType","parameterTypes":["int"] }, {"name":"setValue","parameterTypes":["java.lang.Object"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.KeyType", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.rm.datasource.sql.struct.KeyType", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$$Lambda/0x00007f3e4bc2af00"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.StatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row", + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$$Lambda/0x00007f3e4bc17788"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.BaseTransactionalExecutor"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.ExecuteTemplate"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.AbstractUndoLogManager"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.rm.datasource.sql.struct.Row", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"getFields","parameterTypes":[] }, {"name":"setFields","parameterTypes":["java.util.List"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$$Lambda/0x00007f3e4bc2af00"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.StatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords", + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$$Lambda/0x00007f3e4bc17788"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.BaseTransactionalExecutor"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.ExecuteTemplate"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.AbstractUndoLogManager"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"getRows","parameterTypes":[] }, {"name":"getTableName","parameterTypes":[] }, {"name":"setRows","parameterTypes":["java.util.List"] }, {"name":"setTableName","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords$EmptyTableRecords", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.rm.datasource.sql.struct.TableRecords$EmptyTableRecords", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"org.apache.seata.rm.datasource.sql.struct.cache.DmTableMetaCache" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"org.apache.seata.rm.datasource.sql.struct.cache.MariadbTableMetaCache" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"org.apache.seata.rm.datasource.sql.struct.cache.MysqlTableMetaCache" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"org.apache.seata.rm.datasource.sql.struct.cache.OracleTableMetaCache" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"org.apache.seata.rm.datasource.sql.struct.cache.PolarDBXTableMetaCache" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"org.apache.seata.rm.datasource.sql.struct.cache.PostgresqlTableMetaCache", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.struct.TableMetaCacheFactory"}, + "name":"org.apache.seata.rm.datasource.sql.struct.cache.SqlServerTableMetaCache" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$$Lambda/0x00007f3e4bc2af00"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.StatementProxy"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog", + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$$Lambda/0x00007f3e4bc17788"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.BaseTransactionalExecutor"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.ExecuteTemplate"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.AbstractUndoLogManager"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.rm.datasource.undo.BranchUndoLog", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"getBranchId","parameterTypes":[] }, {"name":"getSqlUndoLogs","parameterTypes":[] }, {"name":"getXid","parameterTypes":[] }, {"name":"setBranchId","parameterTypes":["long"] }, {"name":"setSqlUndoLogs","parameterTypes":["java.util.List"] }, {"name":"setXid","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$$Lambda/0x00007f3e4bc2af00"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.ConnectionProxy$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.StatementProxy"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog", + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$$Lambda/0x00007f3e4bc17788"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.BaseTransactionalExecutor"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.exec.ExecuteTemplate"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.AbstractUndoLogManager"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.rm.datasource.undo.SQLUndoLog", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"getAfterImage","parameterTypes":[] }, {"name":"getBeforeImage","parameterTypes":[] }, {"name":"getSqlType","parameterTypes":[] }, {"name":"getTableName","parameterTypes":[] }, {"name":"setAfterImage","parameterTypes":["org.apache.seata.rm.datasource.sql.struct.TableRecords"] }, {"name":"setBeforeImage","parameterTypes":["org.apache.seata.rm.datasource.sql.struct.TableRecords"] }, {"name":"setSqlType","parameterTypes":["org.apache.seata.sqlparser.SQLType"] }, {"name":"setTableName","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"org.apache.seata.rm.datasource.undo.dm.DmUndoExecutorHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"org.apache.seata.rm.datasource.undo.dm.DmUndoLogManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"org.apache.seata.rm.datasource.undo.mariadb.MariadbUndoExecutorHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"org.apache.seata.rm.datasource.undo.mariadb.MariadbUndoLogManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"org.apache.seata.rm.datasource.undo.mysql.MySQLUndoExecutorHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"org.apache.seata.rm.datasource.undo.mysql.MySQLUndoLogManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"org.apache.seata.rm.datasource.undo.oracle.OracleUndoExecutorHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"org.apache.seata.rm.datasource.undo.oracle.OracleUndoLogManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogParserFactory"}, + "name":"org.apache.seata.rm.datasource.undo.parser.FastjsonUndoLogParser" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogParserFactory"}, + "name":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogParserFactory"}, + "name":"org.apache.seata.rm.datasource.undo.parser.KryoUndoLogParser" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogParserFactory"}, + "name":"org.apache.seata.rm.datasource.undo.parser.ProtostuffUndoLogParser" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"org.apache.seata.rm.datasource.undo.polardbx.PolarDBXUndoExecutorHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"org.apache.seata.rm.datasource.undo.polardbx.PolarDBXUndoLogManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"org.apache.seata.rm.datasource.undo.postgresql.PostgresqlUndoExecutorHolder", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"org.apache.seata.rm.datasource.undo.postgresql.PostgresqlUndoLogManager", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoExecutorHolderFactory"}, + "name":"org.apache.seata.rm.datasource.undo.sqlserver.SqlServerUndoExecutorHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.UndoLogManagerFactory"}, + "name":"org.apache.seata.rm.datasource.undo.sqlserver.SqlServerUndoLogManager" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultResourceManager"}, + "name":"org.apache.seata.rm.datasource.xa.ResourceManagerXA", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultRMHandler"}, + "name":"org.apache.seata.rm.tcc.RMHandlerTCC", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultResourceManager"}, + "name":"org.apache.seata.rm.tcc.TCCResourceManager", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultRMHandler"}, + "name":"org.apache.seata.saga.rm.RMHandlerSaga", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.DefaultResourceManager"}, + "name":"org.apache.seata.saga.rm.SagaResourceManager", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.serializer.SerializerServiceLoader"}, + "name":"org.apache.seata.serializer.hessian.HessianSerializer" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.serializer.SerializerServiceLoader"}, + "name":"org.apache.seata.serializer.kryo.KryoSerializer" +}, +{ + "condition":{"typeReachable":"org.apache.seata.core.serializer.SerializerServiceLoader"}, + "name":"org.apache.seata.serializer.seata.SeataSerializer", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.PreparedStatementProxy"}, + "name":"org.apache.seata.sqlparser.SQLType", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.sqlparser.SQLType", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.druid.DruidDelegatingDbTypeParser"}, + "name":"org.apache.seata.sqlparser.druid.DruidDbTypeParserImpl", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.util.JdbcUtils"}, + "name":"org.apache.seata.sqlparser.druid.DruidDelegatingDbTypeParser", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.sql.SQLVisitorFactory"}, + "name":"org.apache.seata.sqlparser.druid.DruidDelegatingSQLRecognizerFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.druid.DruidDelegatingSQLRecognizerFactory"}, + "name":"org.apache.seata.sqlparser.druid.DruidSQLRecognizerFactoryImpl", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"org.apache.seata.sqlparser.druid.dm.DmOperateRecognizerHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"org.apache.seata.sqlparser.druid.mariadb.MariadbOperateRecognizerHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"org.apache.seata.sqlparser.druid.mysql.MySQLOperateRecognizerHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"org.apache.seata.sqlparser.druid.oracle.OracleOperateRecognizerHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"org.apache.seata.sqlparser.druid.polardbx.PolarDBXOperateRecognizerHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"org.apache.seata.sqlparser.druid.postgresql.PostgresqlOperateRecognizerHolder", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.seata.common.loader.EnhancedServiceLoader"}, + "name":"org.apache.seata.sqlparser.druid.sqlserver.SqlServerOperateRecognizerHolder" +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.sqlparser.struct.ColumnMeta", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.sqlparser.struct.IndexMeta", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.sqlparser.struct.IndexType", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.rm.datasource.undo.parser.JacksonUndoLogParser"}, + "name":"org.apache.seata.sqlparser.struct.TableMeta", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.seata.tm.TransactionManagerHolder$SingletonHolder"}, + "name":"org.apache.seata.tm.DefaultTransactionManager", + "methods":[{"name":"","parameterTypes":[] }] +} +] diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/resource-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/resource-config.json new file mode 100644 index 0000000000000..3566f24e8e9fa --- /dev/null +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.seata/seata-all/2.1.0/resource-config.json @@ -0,0 +1,20 @@ +{ + "resources":{ + "includes":[{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "pattern":".*META-INF/services/io\\.seata\\..+" + },{ + "condition":{"typeReachable":"org.apache.seata.config.ConfigurationFactory"}, + "pattern":".*META-INF/services/org\\.apache\\.seata\\..+" + },{ + "condition":{"typeReachable":"org.apache.seata.sqlparser.druid.DruidDbTypeParserImpl"}, + "pattern":"\\QMETA-INF/druid-driver.properties\\E" + }, { + "condition":{"typeReachable":"org.apache.seata.config.FileConfiguration"}, + "pattern":"\\Q\\E" + }, { + "condition":{"typeReachable":"org.apache.seata.sqlparser.druid.DefaultDruidLoader"}, + "pattern":"\\Qlib/sqlparser/druid.jar\\E" + }]}, + "bundles":[] +} diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/proxy-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/proxy-config.json index 7a6a8cf430f64..5bf2e70b3c283 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/proxy-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/proxy-config.json @@ -1,8 +1,4 @@ [ - { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "interfaces":["io.seata.config.Configuration"] - }, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, "interfaces":["java.sql.Connection"] @@ -10,5 +6,9 @@ { "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder"}, "interfaces":["org.apache.hive.service.rpc.thrift.TCLIService$Iface"] + }, + { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "interfaces":["org.apache.seata.config.Configuration"] } ] \ No newline at end of file diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json index 55fb5da627a1c..8e703e118f8c5 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json @@ -127,7 +127,7 @@ "name":"org.apache.shardingsphere.broadcast.yaml.config.YamlBroadcastRuleConfiguration" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.database.DatabaseRulePersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.MetaDataPersistService"}, "name":"org.apache.shardingsphere.broadcast.yaml.config.YamlBroadcastRuleConfiguration", "allDeclaredFields":true }, @@ -320,7 +320,7 @@ "methods":[{"name":"","parameterTypes":[] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.database.DatabaseRulePersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.MetaDataPersistService"}, "name":"org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration", "allDeclaredFields":true, "methods":[{"name":"getProps","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }] @@ -752,6 +752,10 @@ "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.persist.ClusterMetaDataManagerPersistService"}, "name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTableCustomizer" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.infra.rule.builder.global.GlobalRulesBuilder"}, + "name":"org.apache.shardingsphere.logging.rule.builder.DefaultLoggingRuleConfigurationBuilder" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.rule.builder.global.GlobalRulesBuilder"}, "name":"org.apache.shardingsphere.logging.rule.builder.LoggingRuleBuilder" @@ -760,6 +764,25 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"}, "name":"org.apache.shardingsphere.logging.yaml.config.YamlLoggingRuleConfiguration" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.global.GlobalRulePersistService"}, + "name":"org.apache.shardingsphere.logging.yaml.config.YamlLoggingRuleConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"getAppenders","parameterTypes":[] }, {"name":"getLoggers","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.logging.yaml.config.YamlLoggingRuleConfiguration", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.logging.yaml.config.YamlLoggingRuleConfigurationBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.logging.yaml.config.YamlLoggingRuleConfigurationCustomizer" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.mask.checker.MaskRuleConfigurationChecker"}, "name":"org.apache.shardingsphere.mask.algorithm.cover.KeepFirstNLastMMaskAlgorithm", @@ -949,7 +972,7 @@ "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.listener.MetaDataChangedListener$$Lambda/0x00007f04a35d5a38"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.listener.DatabaseMetaDataChangedListener$$Lambda/0x00007f11035c8eb8"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.MetaDataChangedSubscriber" }, { @@ -1300,7 +1323,7 @@ "name":"org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.database.DatabaseRulePersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.MetaDataPersistService"}, "name":"org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration", "allDeclaredFields":true }, @@ -1320,7 +1343,7 @@ "methods":[{"name":"","parameterTypes":[] }, {"name":"setActualDataNodes","parameterTypes":["java.lang.String"] }, {"name":"setKeyGenerateStrategy","parameterTypes":["org.apache.shardingsphere.sharding.yaml.config.strategy.keygen.YamlKeyGenerateStrategyConfiguration"] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.database.DatabaseRulePersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.MetaDataPersistService"}, "name":"org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration", "allDeclaredFields":true, "methods":[{"name":"getActualDataNodes","parameterTypes":[] }, {"name":"getAuditStrategy","parameterTypes":[] }, {"name":"getDatabaseStrategy","parameterTypes":[] }, {"name":"getKeyGenerateStrategy","parameterTypes":[] }, {"name":"getLogicTable","parameterTypes":[] }, {"name":"getTableStrategy","parameterTypes":[] }] @@ -1361,7 +1384,7 @@ "methods":[{"name":"","parameterTypes":[] }, {"name":"setStandard","parameterTypes":["org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlStandardShardingStrategyConfiguration"] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.database.DatabaseRulePersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.MetaDataPersistService"}, "name":"org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlShardingStrategyConfiguration", "allDeclaredFields":true, "methods":[{"name":"getComplex","parameterTypes":[] }, {"name":"getHint","parameterTypes":[] }, {"name":"getNone","parameterTypes":[] }, {"name":"getStandard","parameterTypes":[] }] diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json index fd1b1b92e6ce2..612210b1a3bf5 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json @@ -17,7 +17,7 @@ "pattern":"\\QMETA-INF/native/libnetty_transport_native_epoll_x86_64.so\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/io.seata.config.ExtConfigurationProvider\\E" + "pattern":"\\QMETA-INF/seata/io.seata.config.ConfigurationProvider\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, "pattern":"\\QMETA-INF/seata/io.seata.core.auth.AuthSigner\\E" @@ -29,19 +29,40 @@ "pattern":"\\QMETA-INF/seata/io.seata.core.model.ResourceManager\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/io.seata.core.model.TransactionManager\\E" + "pattern":"\\QMETA-INF/seata/io.seata.discovery.registry.RegistryProvider\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/io.seata.core.rpc.hook.RpcHook\\E" + "pattern":"\\QMETA-INF/seata/org.apache.seata.config.ConfigurationProvider\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/io.seata.discovery.registry.RegistryProvider\\E" + "pattern":"\\QMETA-INF/seata/org.apache.seata.config.ExtConfigurationProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/seata/org.apache.seata.core.auth.AuthSigner\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionalSQLExecutionHook"}, + "pattern":"\\QMETA-INF/seata/org.apache.seata.core.context.ContextCore\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/seata/org.apache.seata.core.model.ResourceManager\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/seata/org.apache.seata.core.model.TransactionManager\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/seata/org.apache.seata.core.rpc.hook.RpcHook\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/io.seata.rm.AbstractRMHandler\\E" + "pattern":"\\QMETA-INF/seata/org.apache.seata.discovery.registry.RegistryProvider\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/io.seata.sqlparser.util.DbTypeParser\\E" + "pattern":"\\QMETA-INF/seata/org.apache.seata.rm.AbstractRMHandler\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/seata/org.apache.seata.rm.datasource.undo.UndoLogManager\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/seata/org.apache.seata.sqlparser.util.DbTypeParser\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider"}, "pattern":"\\QMETA-INF/services/com.atomikos.icatch.TransactionServicePlugin\\E" @@ -74,7 +95,7 @@ "pattern":"\\QMETA-INF/services/io.grpc.NameResolverProvider\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/io.seata.config.ExtConfigurationProvider\\E" + "pattern":"\\QMETA-INF/services/io.seata.config.ConfigurationProvider\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, "pattern":"\\QMETA-INF/services/io.seata.core.auth.AuthSigner\\E" @@ -84,21 +105,9 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, "pattern":"\\QMETA-INF/services/io.seata.core.model.ResourceManager\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/io.seata.core.model.TransactionManager\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/io.seata.core.rpc.hook.RpcHook\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, "pattern":"\\QMETA-INF/services/io.seata.discovery.registry.RegistryProvider\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/io.seata.rm.AbstractRMHandler\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/io.seata.sqlparser.util.DbTypeParser\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"}, "pattern":"\\QMETA-INF/services/io.vertx.core.spi.VerticleFactory\\E" @@ -117,6 +126,39 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader"}, "pattern":"\\QMETA-INF/services/javax.xml.stream.XMLOutputFactory\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.config.ConfigurationProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.config.ExtConfigurationProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.core.auth.AuthSigner\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataTransactionalSQLExecutionHook"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.core.context.ContextCore\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.core.model.ResourceManager\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.core.model.TransactionManager\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.core.rpc.hook.RpcHook\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.discovery.registry.RegistryProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.rm.AbstractRMHandler\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.rm.datasource.undo.UndoLogManager\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "pattern":"\\QMETA-INF/services/org.apache.seata.sqlparser.util.DbTypeParser\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.authority.rule.AuthorityRule"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.authority.spi.PrivilegeProvider\\E" @@ -192,6 +234,9 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlModeConfigurationSwapper"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.logging.rule.builder.DefaultLoggingRuleConfigurationBuilder"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.logging.spi.ShardingSphereLogBuilder\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.cluster.lock.holder.DistributedLockHolder"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator\\E" diff --git a/kernel/transaction/type/base/seata-at/pom.xml b/kernel/transaction/type/base/seata-at/pom.xml index 4704e15b3557f..6181fa3202886 100644 --- a/kernel/transaction/type/base/seata-at/pom.xml +++ b/kernel/transaction/type/base/seata-at/pom.xml @@ -29,7 +29,7 @@ - io.seata + org.apache.seata seata-all ${seata.version} @@ -55,41 +55,9 @@ - org.apache.shardingsphere - shardingsphere-test-fixture-database - ${project.version} - test - - - - io.seata + org.apache.seata seata-all - ${seata.version} provided - - - com.oracle - ojdbc6 - - - com.alibaba - dubbo - - - com.sun - tools - - - com.sun - jconsole - - - - - - com.fasterxml.jackson.core - jackson-databind - test diff --git a/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManager.java b/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManager.java index a15aab9731376..d0e2abcc26650 100644 --- a/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManager.java +++ b/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManager.java @@ -17,17 +17,18 @@ package org.apache.shardingsphere.transaction.base.seata.at; -import io.seata.config.FileConfiguration; -import io.seata.core.context.RootContext; -import io.seata.core.exception.TransactionException; -import io.seata.core.rpc.netty.RmNettyRemotingClient; -import io.seata.core.rpc.netty.TmNettyRemotingClient; -import io.seata.rm.RMClient; -import io.seata.rm.datasource.DataSourceProxy; -import io.seata.tm.TMClient; -import io.seata.tm.api.GlobalTransaction; -import io.seata.tm.api.GlobalTransactionContext; import lombok.SneakyThrows; +import org.apache.seata.config.FileConfiguration; +import org.apache.seata.core.context.RootContext; +import org.apache.seata.core.exception.TransactionException; +import org.apache.seata.core.rpc.netty.RmNettyRemotingClient; +import org.apache.seata.core.rpc.netty.TmNettyRemotingClient; +import org.apache.seata.rm.RMClient; +import org.apache.seata.rm.datasource.DataSourceProxy; +import org.apache.seata.tm.TMClient; +import org.apache.seata.tm.api.GlobalTransaction; +import org.apache.seata.tm.api.GlobalTransactionContext; +import org.apache.seata.tm.api.GlobalTransactionRole; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions; import org.apache.shardingsphere.transaction.api.TransactionType; @@ -115,12 +116,15 @@ public void begin(final int timeout) { @SneakyThrows(TransactionException.class) public void commit(final boolean rollbackOnly) { checkSeataATEnabled(); + GlobalTransaction globalTransaction = SeataTransactionHolder.get(); try { - SeataTransactionHolder.get().commit(); + globalTransaction.commit(); } finally { - SeataTransactionHolder.clear(); - RootContext.unbind(); - SeataXIDContext.remove(); + if (!GlobalTransactionRole.Participant.equals(globalTransaction.getGlobalTransactionRole())) { + SeataTransactionHolder.clear(); + RootContext.unbind(); + SeataXIDContext.remove(); + } } } diff --git a/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionHolder.java b/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionHolder.java index 350adfdf30c20..270dcdbb7fc65 100644 --- a/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionHolder.java +++ b/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionHolder.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.transaction.base.seata.at; -import io.seata.tm.api.GlobalTransaction; +import org.apache.seata.tm.api.GlobalTransaction; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHook.java b/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHook.java index b260101b465d1..3195b99b6a2e2 100644 --- a/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHook.java +++ b/kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHook.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.transaction.base.seata.at; -import io.seata.core.context.RootContext; +import org.apache.seata.core.context.RootContext; import org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties; import org.apache.shardingsphere.infra.executor.sql.hook.SQLExecutionHook; diff --git a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManagerTest.java b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManagerTest.java index 5ca0caf94c620..0d3f9a921ff96 100644 --- a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManagerTest.java +++ b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManagerTest.java @@ -17,28 +17,28 @@ package org.apache.shardingsphere.transaction.base.seata.at; -import io.seata.core.context.RootContext; -import io.seata.core.protocol.RegisterRMRequest; -import io.seata.core.protocol.RegisterRMResponse; -import io.seata.core.protocol.RegisterTMRequest; -import io.seata.core.protocol.RegisterTMResponse; -import io.seata.core.protocol.transaction.GlobalBeginRequest; -import io.seata.core.protocol.transaction.GlobalBeginResponse; -import io.seata.core.protocol.transaction.GlobalCommitRequest; -import io.seata.core.protocol.transaction.GlobalCommitResponse; -import io.seata.core.protocol.transaction.GlobalRollbackRequest; -import io.seata.core.protocol.transaction.GlobalRollbackResponse; -import io.seata.core.rpc.netty.RmNettyRemotingClient; -import io.seata.core.rpc.netty.TmNettyRemotingClient; -import io.seata.rm.datasource.ConnectionProxy; -import io.seata.rm.datasource.DataSourceProxy; -import io.seata.tm.api.GlobalTransactionContext; import lombok.SneakyThrows; +import org.apache.seata.core.context.RootContext; +import org.apache.seata.core.protocol.RegisterRMRequest; +import org.apache.seata.core.protocol.RegisterRMResponse; +import org.apache.seata.core.protocol.RegisterTMRequest; +import org.apache.seata.core.protocol.RegisterTMResponse; +import org.apache.seata.core.protocol.transaction.GlobalBeginRequest; +import org.apache.seata.core.protocol.transaction.GlobalBeginResponse; +import org.apache.seata.core.protocol.transaction.GlobalCommitRequest; +import org.apache.seata.core.protocol.transaction.GlobalCommitResponse; +import org.apache.seata.core.protocol.transaction.GlobalRollbackRequest; +import org.apache.seata.core.protocol.transaction.GlobalRollbackResponse; +import org.apache.seata.core.rpc.netty.RmNettyRemotingClient; +import org.apache.seata.core.rpc.netty.TmNettyRemotingClient; +import org.apache.seata.rm.datasource.ConnectionProxy; +import org.apache.seata.rm.datasource.DataSourceProxy; +import org.apache.seata.tm.api.GlobalTransactionContext; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; -import org.apache.shardingsphere.test.fixture.jdbc.MockedDataSource; import org.apache.shardingsphere.transaction.api.TransactionType; import org.apache.shardingsphere.transaction.base.seata.at.fixture.MockSeataServer; +import org.apache.shardingsphere.transaction.base.seata.at.fixture.MockedMysqlDataSource; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; @@ -92,7 +92,7 @@ static void after() { @BeforeEach void setUp() { seataTransactionManager.init(Collections.singletonMap("sharding_db.ds_0", TypedSPILoader.getService(DatabaseType.class, "MySQL")), - Collections.singletonMap(DATA_SOURCE_UNIQUE_NAME, new MockedDataSource()), "Seata"); + Collections.singletonMap(DATA_SOURCE_UNIQUE_NAME, new MockedMysqlDataSource()), "Seata"); } @AfterEach diff --git a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHookTest.java b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHookTest.java index 474271c336a6b..5bdde4dedcef3 100644 --- a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHookTest.java +++ b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataTransactionalSQLExecutionHookTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.transaction.base.seata.at; -import io.seata.core.context.RootContext; +import org.apache.seata.core.context.RootContext; import org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockMessageHandler.java b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockMessageHandler.java index e1baff1870603..e823ef5f339c9 100644 --- a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockMessageHandler.java +++ b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockMessageHandler.java @@ -20,37 +20,37 @@ import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; -import io.seata.common.XID; -import io.seata.core.model.GlobalStatus; -import io.seata.core.protocol.AbstractMessage; -import io.seata.core.protocol.AbstractResultMessage; -import io.seata.core.protocol.HeartbeatMessage; -import io.seata.core.protocol.MergeResultMessage; -import io.seata.core.protocol.MergedWarpMessage; -import io.seata.core.protocol.ProtocolConstants; -import io.seata.core.protocol.RegisterRMRequest; -import io.seata.core.protocol.RegisterRMResponse; -import io.seata.core.protocol.RegisterTMRequest; -import io.seata.core.protocol.RegisterTMResponse; -import io.seata.core.protocol.ResultCode; -import io.seata.core.protocol.RpcMessage; -import io.seata.core.protocol.transaction.BranchCommitRequest; -import io.seata.core.protocol.transaction.BranchCommitResponse; -import io.seata.core.protocol.transaction.BranchRegisterRequest; -import io.seata.core.protocol.transaction.BranchRegisterResponse; -import io.seata.core.protocol.transaction.BranchReportRequest; -import io.seata.core.protocol.transaction.BranchReportResponse; -import io.seata.core.protocol.transaction.BranchRollbackRequest; -import io.seata.core.protocol.transaction.BranchRollbackResponse; -import io.seata.core.protocol.transaction.GlobalBeginRequest; -import io.seata.core.protocol.transaction.GlobalBeginResponse; -import io.seata.core.protocol.transaction.GlobalCommitRequest; -import io.seata.core.protocol.transaction.GlobalCommitResponse; -import io.seata.core.protocol.transaction.GlobalRollbackRequest; -import io.seata.core.protocol.transaction.GlobalRollbackResponse; -import io.seata.core.protocol.transaction.GlobalStatusRequest; -import io.seata.core.protocol.transaction.GlobalStatusResponse; import lombok.Getter; +import org.apache.seata.common.XID; +import org.apache.seata.core.model.GlobalStatus; +import org.apache.seata.core.protocol.AbstractMessage; +import org.apache.seata.core.protocol.AbstractResultMessage; +import org.apache.seata.core.protocol.HeartbeatMessage; +import org.apache.seata.core.protocol.MergeResultMessage; +import org.apache.seata.core.protocol.MergedWarpMessage; +import org.apache.seata.core.protocol.ProtocolConstants; +import org.apache.seata.core.protocol.RegisterRMRequest; +import org.apache.seata.core.protocol.RegisterRMResponse; +import org.apache.seata.core.protocol.RegisterTMRequest; +import org.apache.seata.core.protocol.RegisterTMResponse; +import org.apache.seata.core.protocol.ResultCode; +import org.apache.seata.core.protocol.RpcMessage; +import org.apache.seata.core.protocol.transaction.BranchCommitRequest; +import org.apache.seata.core.protocol.transaction.BranchCommitResponse; +import org.apache.seata.core.protocol.transaction.BranchRegisterRequest; +import org.apache.seata.core.protocol.transaction.BranchRegisterResponse; +import org.apache.seata.core.protocol.transaction.BranchReportRequest; +import org.apache.seata.core.protocol.transaction.BranchReportResponse; +import org.apache.seata.core.protocol.transaction.BranchRollbackRequest; +import org.apache.seata.core.protocol.transaction.BranchRollbackResponse; +import org.apache.seata.core.protocol.transaction.GlobalBeginRequest; +import org.apache.seata.core.protocol.transaction.GlobalBeginResponse; +import org.apache.seata.core.protocol.transaction.GlobalCommitRequest; +import org.apache.seata.core.protocol.transaction.GlobalCommitResponse; +import org.apache.seata.core.protocol.transaction.GlobalRollbackRequest; +import org.apache.seata.core.protocol.transaction.GlobalRollbackResponse; +import org.apache.seata.core.protocol.transaction.GlobalStatusRequest; +import org.apache.seata.core.protocol.transaction.GlobalStatusResponse; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; diff --git a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockSeataServer.java b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockSeataServer.java index 0cbb96005bd40..a7d32ee88fcff 100644 --- a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockSeataServer.java +++ b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockSeataServer.java @@ -26,8 +26,8 @@ import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.seata.core.rpc.netty.v1.ProtocolV1Decoder; -import io.seata.core.rpc.netty.v1.ProtocolV1Encoder; +import org.apache.seata.core.rpc.netty.v1.ProtocolV1Decoder; +import org.apache.seata.core.rpc.netty.v1.ProtocolV1Encoder; import lombok.Getter; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockedMysqlDataSource.java b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockedMysqlDataSource.java new file mode 100644 index 0000000000000..2c586fc1da09c --- /dev/null +++ b/kernel/transaction/type/base/seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/fixture/MockedMysqlDataSource.java @@ -0,0 +1,131 @@ +/* + * 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.transaction.base.seata.at.fixture; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.sql.DataSource; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.logging.Logger; + +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.Mockito.RETURNS_DEEP_STUBS; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@NoArgsConstructor +@Getter +@Setter +public class MockedMysqlDataSource implements DataSource, AutoCloseable { + + private String url = "jdbc:mysql://127.0.0.1:3306/foo_ds"; + + private String driverClassName; + + private String username = "root"; + + private String password = ""; + + private Integer maxPoolSize; + + private Integer minPoolSize; + + private List connectionInitSqls; + + private Properties jdbcUrlProperties; + + @Getter(AccessLevel.NONE) + @Setter(AccessLevel.NONE) + private Connection connection; + + @Setter(AccessLevel.NONE) + private boolean closed; + + private final Collection openedConnections = new HashSet<>(); + + @SuppressWarnings("MagicConstant") + @Override + public Connection getConnection() throws SQLException { + if (null != connection) { + return connection; + } + Connection result = mock(Connection.class, RETURNS_DEEP_STUBS); + when(result.getMetaData().getURL()).thenReturn(url); + when(result.createStatement(anyInt(), anyInt(), anyInt()).getConnection()).thenReturn(result); + doAnswer(invocation -> openedConnections.remove(result)).when(result).close(); + openedConnections.add(result); + return result; + } + + @Override + public Connection getConnection(final String username, final String password) throws SQLException { + return getConnection(); + } + + @SuppressWarnings("unchecked") + @Override + public T unwrap(final Class iface) throws SQLException { + if (iface.isInstance(this)) { + return (T) this; + } + throw new SQLException("Wrapped DataSource is not an instance of " + iface); + } + + @Override + public boolean isWrapperFor(final Class iface) { + return false; + } + + @Override + public PrintWriter getLogWriter() { + return null; + } + + @Override + public void setLogWriter(final PrintWriter out) { + } + + @Override + public void setLoginTimeout(final int seconds) { + } + + @Override + public int getLoginTimeout() { + return 0; + } + + @Override + public Logger getParentLogger() { + return null; + } + + @Override + public void close() { + closed = true; + } +} diff --git a/pom.xml b/pom.xml index 12978428b7256..c2e7286dd2130 100644 --- a/pom.xml +++ b/pom.xml @@ -95,7 +95,7 @@ 5.12.7.Final 7.6.1.Final 3.2.1.Final - 2.0.0 + 2.1.0 4.1.112.Final 1.78.1 diff --git a/test/native/pom.xml b/test/native/pom.xml index d2e327c31734c..07c1acab77638 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -26,12 +26,6 @@ shardingsphere-test-native ${project.artifactId} - - - 1.8.0 - - org.apache.shardingsphere @@ -106,7 +100,7 @@ using Seata Client under GraalVM Native Image requires using the version release test - io.seata + org.apache.seata seata-all ${seata.version} test