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: part of the connection is not unpacked #3071

Merged
merged 8 commits into from
Sep 15, 2020

Conversation

funky-eyes
Copy link
Contributor

Ⅰ. Describe what this PR did

connection 为com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl
如果创建druid连接池时加入了Filter就会变成由ConnectionProxyImpl来实现connection
例如:

 List<Filter> proxyFilters = new ArrayList();
if (!StringUtils.isEmpty(filters) && filters.contains("wall")) {
            WallConfig wallConfig = DruidWallConfigUtil.toWallConfig(dataSourceProperty.getDruid().getWall(), this.druidConfig.getWall());
            WallFilter wallFilter = new WallFilter();
            wallFilter.setConfig(wallConfig);
            proxyFilters.add(wallFilter);
        }
dataSource.setProxyFilters(proxyFilters);

此时datasourcexa中的getconnection获取到的connection是无法创建xaconnection

Ⅱ. Does this pull request fix one issue?

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2020

Codecov Report

Merging #3071 into develop will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3071      +/-   ##
=============================================
- Coverage      50.56%   50.55%   -0.02%     
+ Complexity      3102     3101       -1     
=============================================
  Files            599      599              
  Lines          19516    19514       -2     
  Branches        2405     2404       -1     
=============================================
- Hits            9868     9865       -3     
  Misses          8657     8657              
- Partials         991      992       +1     
Impacted Files Coverage Δ Complexity Δ
...a/io/seata/rm/datasource/xa/DataSourceProxyXA.java 87.50% <100.00%> (+4.16%) 4.00 <1.00> (ø)
...o/seata/server/coordinator/DefaultCoordinator.java 54.63% <0.00%> (-0.52%) 29.00% <0.00%> (ø%)
...in/java/io/seata/server/session/GlobalSession.java 82.43% <0.00%> (-0.46%) 70.00% <0.00%> (-1.00%)

@funky-eyes funky-eyes changed the title support: the druid connectionProxy support: support the druid connectionProxy Aug 31, 2020
@funky-eyes funky-eyes changed the title support: support the druid connectionProxy bugfix: support the druid connectionProxy Aug 31, 2020
@funky-eyes funky-eyes added this to the 1.4.0 milestone Aug 31, 2020
@funky-eyes funky-eyes added the module/rm-datasource rm-datasource module label Aug 31, 2020
Copy link
Contributor

@wangliang181230 wangliang181230 left a comment

Choose a reason for hiding this comment

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

LGTM

@wangliang181230
Copy link
Contributor

很多数据库连接池框架的连接并没有实现过PooledConnection,很是奇怪。Hikari就是没实现过PooledConnection。
只能unwrap了,唉。

@funky-eyes funky-eyes changed the title bugfix: support the druid connectionProxy bugfix: part of the connection is not unpacked Sep 2, 2020
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

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@l81893521 l81893521 merged commit 82d8ee4 into apache:develop Sep 15, 2020
l81893521 pushed a commit to l81893521/seata that referenced this pull request Oct 22, 2020
hicf pushed a commit to hicf/seata that referenced this pull request Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/rm-datasource rm-datasource module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants