| <?xml version="1.0" encoding="utf-8" standalone="yes"?> |
| <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| <channel> |
| <title>Transaction on ShardingSphere</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/</link> |
| <description>Recent content in Transaction on ShardingSphere</description> |
| <generator>Hugo -- gohugo.io</generator> |
| <language>en-us</language> |
| |
| <atom:link href="https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/index.xml" rel="self" type="application/rss+xml" /> |
| |
| |
| <item> |
| <title>Use Java API</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/java-api/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/java-api/</guid> |
| <description>Background With ShardingSphere-JDBC, XA and BASE mode transactions can be used through the API. |
| Prerequisites Introducing Maven dependency |
| &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA&#39;s Narayana mode --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-narayana&lt;/artifactId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using BASE transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-base-seata-at&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; Procedure Set the transaction type Perform the business logic Sample TransactionTypeHolder.</description> |
| </item> |
| |
| <item> |
| <title>Use Spring Boot Starter</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/spring-boot-starter/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/spring-boot-starter/</guid> |
| <description>Background ShardingSphere-JDBC can be used through spring boot starter. |
| Prerequisites Introducing Maven dependency |
| &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-core-spring-boot-starter&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA&#39;s Narayana mode --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-narayana&lt;/artifactId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using BASE transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-base-seata-at&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; Procedure Configure the transaction Type Use distributed transactions Sample Configure the transaction Type @Configuration @EnableTransactionManagement public class TransactionConfiguration { @Bean public PlatformTransactionManager txManager(final DataSource dataSource) { return new DataSourceTransactionManager(dataSource); } @Bean public JdbcTemplate jdbcTemplate(final DataSource dataSource) { return new JdbcTemplate(dataSource); } } Use distributed transactions @Transactional @ShardingSphereTransactionType(TransactionType.</description> |
| </item> |
| |
| <item> |
| <title>Use Spring Namespace</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/spring-namespace/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/spring-namespace/</guid> |
| <description>Background ShardingSphere-JDBC can be used through spring namespace. |
| Prerequisites Introducing Maven denpendency |
| &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-core-spring-namespace&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA&#39;s Narayana mode --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-narayana&lt;/artifactId&gt; &lt;version&gt;${project.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using BASE transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-base-seata-at&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; Procedure Configure the transaction manager Use distributed transactions Sample Configure the transaction manager &lt;!</description> |
| </item> |
| |
| <item> |
| <title>Atomikos Transaction</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/atomikos/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/atomikos/</guid> |
| <description>Background Apache ShardingSphere provides XA transactions, and the default XA transaction manager is Atomikos. |
| Procedure Configure the transaction type Configure Atomikos Sample Configure the transaction type Yaml: |
| - !TRANSACTION defaultType: XA providerType: Atomikos SpringBoot: |
| spring: shardingsphere: props: xa-transaction-manager-type: Atomikos Spring Namespace: |
| &lt;shardingsphere:data-source id=&#34;xxx&#34; data-source-names=&#34;xxx&#34; rule-refs=&#34;xxx&#34;&gt; &lt;props&gt; &lt;prop key=&#34;xa-transaction-manager-type&#34;&gt;Atomikos&lt;/prop&gt; &lt;/props&gt; &lt;/shardingsphere:data-source&gt; Configure Atomikos Atomikos configuration items can be customized by adding jta.properties to the project&rsquo;s classpath. |
| See Atomikos&rsquo;s official documentation for more details.</description> |
| </item> |
| |
| <item> |
| <title>Bitronix Transaction</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/bitronix/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/bitronix/</guid> |
| <description>background Apache ShardingSphere provides XA transactions that integrate with the Bitronix implementation. |
| Prerequisites Introducing Maven dependency |
| &lt;properties&gt; &lt;btm.version&gt;2.1.3&lt;/btm.version&gt; &lt;/properties&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-bitronix&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.codehaus.btm&lt;/groupId&gt; &lt;artifactId&gt;btm&lt;/artifactId&gt; &lt;version&gt;${btm.version}&lt;/version&gt; &lt;/dependency&gt; Procedure Configure the XA transaction type Configure Bitronix Sample Configure the XA transaction type Yaml: |
| - !TRANSACTION defaultType: XA providerType: Bitronix SpringBoot:</description> |
| </item> |
| |
| <item> |
| <title>Narayana Transaction</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/narayana/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/narayana/</guid> |
| <description>Background Apache ShardingSphere provides XA transactions that integrate with the Narayana implementation. |
| Prerequisites Introducing Maven dependency |
| &lt;properties&gt; &lt;narayana.version&gt;5.12.4.Final&lt;/narayana.version&gt; &lt;jboss-transaction-spi.version&gt;7.6.0.Final&lt;/jboss-transaction-spi.version&gt; &lt;jboss-logging.version&gt;3.2.1.Final&lt;/jboss-logging.version&gt; &lt;/properties&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- This module is required when using XA transactions --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-core&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-narayana&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jboss.narayana.jta&lt;/groupId&gt; &lt;artifactId&gt;jta&lt;/artifactId&gt; &lt;version&gt;${narayana.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jboss.narayana.jts&lt;/groupId&gt; &lt;artifactId&gt;narayana-jts-integration&lt;/artifactId&gt; &lt;version&gt;${narayana.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jboss&lt;/groupId&gt; &lt;artifactId&gt;jboss-transaction-spi&lt;/artifactId&gt; &lt;version&gt;${jboss-transaction-spi.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jboss.logging&lt;/groupId&gt; &lt;artifactId&gt;jboss-logging&lt;/artifactId&gt; &lt;version&gt;${jboss-logging.version}&lt;/version&gt; &lt;/dependency&gt; Procedure Configure Narayana Set the XA transaction type Sample Configure Narayana Narayana configuration items can be customized by adding jbossts-properties.</description> |
| </item> |
| |
| <item> |
| <title>Seata Transaction</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/seata/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/special-api/transaction/seata/</guid> |
| <description>Background Apache ShardingSphere provides BASE transactions that integrate the Seata implementation. |
| Procedure Start Seata Server Create the log table Add the Seata configuration Sample Start Seata Server Refer to seata-work-shop to download and start the Seata server. |
| Create undo_log table Create the undo_log table in each shard database instance (take MySQL as an example). |
| CREATE TABLE IF NOT EXISTS `undo_log` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT &#39;increment id&#39;, `branch_id` BIGINT(20) NOT NULL COMMENT &#39;branch transaction id&#39;, `xid` VARCHAR(100) NOT NULL COMMENT &#39;global transaction id&#39;, `context` VARCHAR(128) NOT NULL COMMENT &#39;undo_log context,such as serialization&#39;, `rollback_info` LONGBLOB NOT NULL COMMENT &#39;rollback info&#39;, `log_status` INT(11) NOT NULL COMMENT &#39;0:normal status,1:defense status&#39;, `log_created` DATETIME NOT NULL COMMENT &#39;create datetime&#39;, `log_modified` DATETIME NOT NULL COMMENT &#39;modify datetime&#39;, PRIMARY KEY (`id`), UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`) ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8 COMMENT =&#39;AT transaction mode undo table&#39;; Modify configuration Add the seata.</description> |
| </item> |
| |
| </channel> |
| </rss> |