Logo
Distributed Transaction

Background #

ShardingSphere provides three modes for distributed transactions LOCAL, XA, BASE.

Parameters #

rules:
  - tRANSACTION
    defaultType: # Transaction mode, optional value LOCAL/XA/BASE
    providerType: # Specific implementation of the mode

Procedure #

Use LOCAL Mode #

The content of the server.yaml configuration file is as follows:

rules:
  - tRANSACTION
    defaultType: LOCAL

Use XA Mode #

The content of the server.yaml configuration file is as follows:

rules:
  - tRANSACTION
    defaultType: XA
    providerType: Narayana/Atomikos 

Instruction

SphereEx-DBPlusEngine comes with Narayana dependencies built in and can be configured directly

Use BASE Mode #

The content of the server.yaml configuration file is as follows:

rules:
  - tRANSACTION
    defaultType: BASE
    providerType: Seata 

Build a Seata Server, add relevant configuration files and Seata dependencies, see ShardingSphere Integrates Seata Flexible Transactions