Using @ShardingTransactionType(TransactionType.XA) does not work
Using @ShardingTransactionType(TransactionType.XA) does not work,how to configure, the error is as follows:, Cause: java.lang.IllegalStateException: Missing the data source name: 'rw0' at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:79) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447) at com.sun.proxy.$Proxy52.selectOne(Unknown Source)
hi, please read the document https://shardingsphere.apache.org/document/legacy/3.x/document/cn/manual/sharding-jdbc/usage/transaction/
this is my configure:
<sharding:data-source id="shardingDataSource">
<sharding:sharding-rule data-source-names="rw0,rw1" default-data-source-name="rw0">
<sharding:table-rules>
<sharding:table-rule logic-table="ic_sku_channel_inventory" actual-data-nodes="rw$->{0..1}.ic_sku_channel_inventory_$->{0..15}"
database-strategy-ref="databaseShardingStrategy" table-strategy-ref="tableShardingStrategy"/>
</sharding:table-rules>
</sharding:sharding-rule>
<sharding:props>
<prop key="sql.show">true</prop>
</sharding:props>
</sharding:data-source>
<import resource="classpath:META-INF/shardingTransaction.xml"/>
@ShardingTransactionType(TransactionType.XA) @Transactional public void freezeInventory(SKUBizInvFreezeSo bizInvFreezeSo){}
My MySQL driver : mysql-connector-java-5.1.45.jar I configured it according to the documentation you said,But,Using @ShardingTransactionType(TransactionType.XA) does not work,the above error occurred
please give me a entire namespace xml configuration. or you can read our example in tag 3.1.0 https://github.com/apache/incubator-shardingsphere-example/tree/3.1.0/sharding-jdbc-example/spring-namespace-nodep-example/spring-namespace-nodep-mybatis-example
I debug it, suggesting this error.
Failed to wrap XADataSource to transactional datasource pool
what datasource are you using? how can i reproduce your error in my local environment. would you please push a demo project to GitHub?
I suggest that you can make a demo based on spring-namespace about the configuration of distributed transactions. In addition, I feel that many of your documents are not very detailed and complete.
datasource : hikariCP
I have provide our spring-namespace-demo with XA transaction to you, it is OK.
I used your ShardingSphere in the project. The company has monitoring and does not allow uploading demos. I configured it according to your documentation, which is the error reported above.
this is spring-namespace-demo with XA transaction ???? https://github.com/apache/incubator-shardingsphere-example/tree/3.1.0/sharding-jdbc-example/spring-namespace-nodep-example/spring-namespace-nodep-mybatis-example
yes, first, please run SpringNamespaceTransactionExample, it include XA transaction type.
ok,I try it ,3Q
Also, when will the version of your ShardingSphere4.0.0 be released?
apache release need a long time, maybe 3 moth
I will mark this issue with invalid, it is your environment problem.