why the xa transaction does not work? #32010
gejing1108
started this conversation in
General
Replies: 1 comment
-
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
version: 5.4.1
I've followed the github step to generate the examples for shardingsphere
and in this example, it runs the named run method to implement xa transaction, while I don't find any annotation on this method, this method only create table, insert records and then drop tables, so I doubt if it can show the function of xa transaction, I've tested in my way:
first, add the transaction type in config file as the sample do:
and then add the bean class as the sample do:
and then import it as the sample do:
and at last, I write a simple method to test it:
in this method, I throw an exception when I've inserted 6 records, if the xa transaction works, it will rollback when the exception appears, while actually, 6 records are inserted into the table, so what have I omitted for xa transaction?
btw: in old version of shardingsphere like 4.X, I should add annotation like @ShardingTransactionType(value = TransactionType.XA), while in the 5.X version, I don't find this annotation, and in the sample generated above, I don't find any annotation on the method
Beta Was this translation helpful? Give feedback.
All reactions