-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
used example【sharding--jdbc--cluster-zookeeper--base-seata】,but don't rollback #30242
Comments
before you run example,please create demo_ds_0, demo_ds_1, demo_ds_2; then you should create table 【undo_log】。 |
sdk install java 21.0.2-graalce
sdk use java 21.0.2-graalce
git clone [email protected]:apache/shardingsphere.git
cd ./shardingsphere/
git reset --hard de192a30c9460bb94385c2a88e766025b211f906
./mvnw clean install -Prelease -T1C -DskipTests -Djacoco.skip=true -Dcheckstyle.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
cd ../
git clone [email protected]:linghengqian/shardingsphere-seata-spring-boot-test.git
cd ./shardingsphere-seata-spring-boot-test/
./mvnw -e -T1C clean test |
|
thanks for reply。i am looking for an example of Seata integration (sharing sphere 5.4.0), in order to integrate sharding-sphere-jdbc(5.4.0) into our project which have bean sued Seata。 |
|
I haven't been seeing anything unscientific in the current branch.I want to ask question:when current branch occurs err,can current branch rollback?can project of following link test the rollback function ? |
Connection connection = dataSource.getConnection();
try {
connection.setAutoCommit(false);
connection.createStatement().executeUpdate("INSERT INTO t_address (address_id, address_name) VALUES (2024, 'address_test_2024')");
connection.createStatement().executeUpdate("INSERT INTO t_table_does_not_exist (test_id_does_not_exist) VALUES (2024)");
connection.commit();
} catch (SQLException e) {
connection.rollback();
} finally {
connection.setAutoCommit(true);
connection.close();
}
try (
Connection conn = dataSource.getConnection();
ResultSet resultSet = conn.createStatement().executeQuery("SELECT * FROM t_address WHERE address_id = 2024")) {
assertThat(resultSet.next(), is(false));
}
|
|
Thanks a lot.I want to ask only question:after integrating shardingsphere-seata, in order to rollback,only method is 【Manually obtain the java.sql.Connection instance created from the ShardingSphere data source, and manually calling rollback() methods】?If that's the case, it may not be very good,Because most people's habits:out-of-the-box |
|
I have two questions,after we integrated shardingsphere-seata |
|
1:two projects use the same transaction group of Seata;
1:through debug, i knows the Seata AT mode is integrated with a ShardingSphere Proxy instance. |
|
thanks a lot .i will try.as long as i have answer,i will write the information here. |
thanks a lot .i will try.as long as i have answer,i will write the information here. |
Bug Report
throw new SQLException(),don't roll back
For English only, other languages will not accept.
Before report a bug, make sure you have:
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore 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?
5.4.1
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
use example ,but don't roll back
Actual behavior
Reason analyze (If you can)
may be bug
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
i used Official demo,only modified ExampleService.insertData(only append 【throw new SQLException();】)
Example codes for reproduce this issue (such as a github link).
https://github.com/dongoewang/sharding--jdbc--cluster-zookeeper--base-seata.git
The text was updated successfully, but these errors were encountered: