although atomikos rollback, but data still exist in database
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ShardingSphere Doc.
Please pay attention on issues you submitted, because we maybe need more details. If no response more than 7 days and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ShardingSphere did you use?
4.0.0-RC1
Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
Expected behavior
the use case as blow (ps : use atomikos)
@Transactional
public void xaTransaction() {
userMapper.insertUser(887, 20);
throw new RuntimeException();
}
the end line with throw RuntimeException, so the insert data user while be rollback
Actual behavior
although atomikos execute rollback, but data still exist in database;
Reason analyze (If you can)
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Example codes for reproduce this issue (such as a github link).
https://github.com/EvanDylan/sharding-samples.git
hi, you have integrated XA transaction in a wrong way. please reference our example.
I have not seen @ShardingTransactionType or TransactionTypeHolder API in your example.
In the version of 4.0.0-RC1 ,annotation of SharindTransationType is not available and the examples of integrated with spring namespace without TransantionTypeHolder too.
You can running the demo directly and rollback log will be print by atomikos, i am not sure this issue cause by Sharding-JDBC
this atomikos log is come for spring-boot jpa
you have open boot autoconfiguration,boot have discovery atomikos jar, so it instance atomikos transaction manager directory, but this is not what sharding need.
In the version of 4.0.0-RC1 ,annotation of SharindTransationType is not available and the examples of integrated with spring namespace without TransantionTypeHolder too.
you can mvn clean install from our https://github.com/OpenSharding/shardingsphere-spi-impl
thanks a lot,I had big mistake,lol
@cherrylzhao the example you has provided also use spring boot autoconfiguration too. So could you pelease update the example and fix the error.
example is ok, we have provided sharding-transaction-spring-boot-starter to avoid it happen, or you can use @exculed annotation manually.
got it, thanks again