Skip to content
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

bugfix:support Statement#execute for SELECT_FOR_UPDATE #875

Merged

Conversation

hongweiyi
Copy link
Contributor

Signed-off-by: hongwei yi hongweiyi@hotmail.com

Ⅰ. Describe what this PR did

support Statement#execute for SELECT_FOR_UPDATE

Ⅱ. Does this pull request fix one issue?

fixes #870

Ⅲ. Why don't you add test cases (unit test/integration test)?

I've tested this in seata-examples. BTW, Seata need more test cases in the project.

Ⅳ. Describe how to verify it

Connection conn = dataSourceProxy.getConnection();
Statement stmt = conn.createStatement();
stmt.execute("select * from table where id=? for update");

Ⅴ. Special notes for reviews

Signed-off-by: hongwei yi <hongweiyi@hotmail.com>
@codecov-io
Copy link

codecov-io commented Apr 23, 2019

Codecov Report

Merging #875 into develop will decrease coverage by 0.18%.
The diff coverage is 0%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #875      +/-   ##
=============================================
- Coverage      38.86%   38.67%   -0.19%     
+ Complexity      1028     1026       -2     
=============================================
  Files            220      220              
  Lines           8501     8498       -3     
  Branches        1024     1023       -1     
=============================================
- Hits            3304     3287      -17     
- Misses          4812     4823      +11     
- Partials         385      388       +3
Impacted Files Coverage Δ Complexity Δ
...ta/rm/datasource/exec/SelectForUpdateExecutor.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...a/io/seata/rm/datasource/exec/ExecuteTemplate.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ain/java/io/seata/core/rpc/netty/ShutdownHook.java 56.25% <0%> (-25%) 6% <0%> (-2%)
...eata/core/rpc/netty/AbstractRpcRemotingClient.java 17.7% <0%> (-2.88%) 7% <0%> (ø)
...eata/server/store/FileTransactionStoreManager.java 53% <0%> (-1%) 15% <0%> (ø)
...java/io/seata/discovery/registry/RegistryType.java 40% <0%> (+0.86%) 2% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a13de66...b67c173. Read the comment docs.

Copy link
Contributor

@zhangthen zhangthen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done.

@slievrly
Copy link
Member

RootContext.bind("123456:8091");
DataSourceProxy dataSourceProxy = (DataSourceProxy)storageContext.getBean("accountDataSourceProxy");
Connection conn = dataSourceProxy.getConnection();
PreparedStatement stmt=conn.prepareStatement("select * from account_tbl where id=36 for update");
stmt.execute();

@slievrly
Copy link
Member

image

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly changed the title fix issue #870, support Statement#execute for SELECT_FOR_UPDATE bugfix:support Statement#execute for SELECT_FOR_UPDATE Apr 23, 2019
@slievrly slievrly merged commit 6d0a6fa into apache:develop Apr 23, 2019
@hongweiyi hongweiyi deleted the support_execute_for_select_for_update branch April 23, 2019 10:33
nick-tan pushed a commit to nick-tan/seata that referenced this pull request Jul 12, 2019
@wangliang181230 wangliang181230 added this to the 0.5.* milestone Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seata error when executing select for update statement with mybatis
5 participants