提交 1d00fd73 编写于 作者: T terrymanu

refactor xa module

上级 7a4a390e
......@@ -19,9 +19,9 @@ package io.shardingsphere.shardingproxy.backend.jdbc.datasource;
import io.shardingsphere.core.constant.DatabaseType;
import io.shardingsphere.core.rule.DataSourceParameter;
import io.shardingsphere.transaction.spi.xa.XATransactionManager;
import io.shardingsphere.transaction.xa.jta.datasource.XADataSourceFactory;
import io.shardingsphere.transaction.xa.manager.XATransactionManagerSPILoader;
import io.shardingsphere.transaction.xa.spi.XATransactionManager;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
......
......@@ -13,7 +13,6 @@
<packaging>pom</packaging>
<modules>
<module>sharding-transaction-2pc-spi</module>
<module>sharding-transaction-2pc-xa</module>
<module>sharding-transaction-xa</module>
</modules>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.shardingsphere</groupId>
<artifactId>sharding-transaction-2pc</artifactId>
<version>4.0.0.M1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sharding-transaction-xa</artifactId>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<modules>
<module>sharding-transaction-xa-spi</module>
<module>sharding-transaction-xa-core</module>
</modules>
</project>
......@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.shardingsphere</groupId>
<artifactId>sharding-transaction-2pc</artifactId>
<artifactId>sharding-transaction-xa</artifactId>
<version>4.0.0.M1-SNAPSHOT</version>
</parent>
<artifactId>sharding-transaction-2pc-xa</artifactId>
......@@ -37,11 +37,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java7</artifactId>
......@@ -52,5 +47,10 @@
<artifactId>commons-dbcp2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -15,18 +15,17 @@
* </p>
*/
package io.shardingsphere.transaction.xa.handler;
package io.shardingsphere.transaction.xa;
import com.atomikos.jdbc.AtomikosDataSourceBean;
import io.shardingsphere.core.constant.DatabaseType;
import io.shardingsphere.core.exception.ShardingException;
import io.shardingsphere.transaction.api.TransactionType;
import io.shardingsphere.transaction.spi.ShardingTransactionEngine;
import io.shardingsphere.transaction.spi.xa.XATransactionManager;
import io.shardingsphere.transaction.xa.jta.connection.ShardingXAConnection;
import io.shardingsphere.transaction.xa.jta.datasource.ShardingXADataSource;
import io.shardingsphere.transaction.xa.manager.XATransactionManagerSPILoader;
import lombok.extern.slf4j.Slf4j;
import io.shardingsphere.transaction.xa.spi.XATransactionManager;
import javax.sql.DataSource;
import javax.transaction.RollbackException;
......@@ -44,7 +43,6 @@ import java.util.Map.Entry;
*
* @author zhaojun
*/
@Slf4j
public final class XAShardingTransactionEngine implements ShardingTransactionEngine {
private final Map<String, ShardingXADataSource> cachedShardingXADataSourceMap = new HashMap<>();
......@@ -94,7 +92,6 @@ public final class XAShardingTransactionEngine implements ShardingTransactionEng
result = shardingXADataSource.getConnectionFromOriginalDataSource();
}
} catch (final SQLException | RollbackException | SystemException ex) {
log.error("Failed to synchronize transactional resource");
throw new ShardingException(ex);
}
return result;
......
......@@ -23,7 +23,7 @@ import com.atomikos.icatch.jta.UserTransactionManager;
import io.shardingsphere.core.constant.DatabaseType;
import io.shardingsphere.core.exception.ShardingException;
import io.shardingsphere.core.rule.DataSourceParameter;
import io.shardingsphere.transaction.spi.xa.XATransactionManager;
import io.shardingsphere.transaction.xa.spi.XATransactionManager;
import javax.sql.DataSource;
import javax.sql.XADataSource;
......
......@@ -19,7 +19,7 @@ package io.shardingsphere.transaction.xa.manager;
import io.shardingsphere.core.exception.ShardingException;
import io.shardingsphere.spi.NewInstanceServiceLoader;
import io.shardingsphere.transaction.spi.xa.XATransactionManager;
import io.shardingsphere.transaction.xa.spi.XATransactionManager;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
......
......@@ -19,7 +19,7 @@ package io.shardingsphere.transaction.xa.fixture;
import io.shardingsphere.core.constant.DatabaseType;
import io.shardingsphere.core.rule.DataSourceParameter;
import io.shardingsphere.transaction.spi.xa.XATransactionManager;
import io.shardingsphere.transaction.xa.spi.XATransactionManager;
import javax.sql.DataSource;
import javax.sql.XADataSource;
......
......@@ -21,10 +21,11 @@ import com.atomikos.jdbc.AtomikosDataSourceBean;
import io.shardingsphere.core.constant.DatabaseType;
import io.shardingsphere.core.constant.PoolType;
import io.shardingsphere.transaction.api.TransactionType;
import io.shardingsphere.transaction.spi.xa.XATransactionManager;
import io.shardingsphere.transaction.xa.XAShardingTransactionEngine;
import io.shardingsphere.transaction.xa.fixture.DataSourceUtils;
import io.shardingsphere.transaction.xa.jta.connection.ShardingXAConnection;
import io.shardingsphere.transaction.xa.jta.datasource.ShardingXADataSource;
import io.shardingsphere.transaction.xa.spi.XATransactionManager;
import lombok.SneakyThrows;
import org.junit.Before;
import org.junit.Test;
......
......@@ -18,8 +18,8 @@
package io.shardingsphere.transaction.xa.manager;
import io.shardingsphere.core.exception.ShardingException;
import io.shardingsphere.transaction.spi.xa.XATransactionManager;
import io.shardingsphere.transaction.xa.fixture.ReflectiveUtil;
import io.shardingsphere.transaction.xa.spi.XATransactionManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
......
......@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.shardingsphere</groupId>
<artifactId>sharding-transaction-2pc</artifactId>
<artifactId>sharding-transaction-xa</artifactId>
<version>4.0.0.M1-SNAPSHOT</version>
</parent>
<artifactId>sharding-transaction-2pc-spi</artifactId>
......
......@@ -15,7 +15,7 @@
* </p>
*/
package io.shardingsphere.transaction.spi.xa;
package io.shardingsphere.transaction.xa.spi;
import io.shardingsphere.core.constant.DatabaseType;
import io.shardingsphere.core.rule.DataSourceParameter;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册