-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
optimize:refactor of auto proxying of datasource. #2095
optimize:refactor of auto proxying of datasource. #2095
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2095 +/- ##
==========================================
Coverage ? 54.41%
Complexity ? 2472
==========================================
Files ? 447
Lines ? 14750
Branches ? 1734
==========================================
Hits ? 8026
Misses ? 5967
Partials ? 757 |
spring/src/main/java/io/seata/spring/annotation/datasource/EnableAutoDataSourceProxy.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/io/seata/spring/annotation/datasource/SeataDataSourceBeanPostProcessor.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/io/seata/spring/annotation/datasource/SeataDataSourceBeanPostProcessor.java
Outdated
Show resolved
Hide resolved
…tor_ds_auto_proxy
spring/src/main/java/io/seata/spring/annotation/datasource/AutoDataSourceProxyRegistrar.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- check spring-cloud-alibaba-seata sample with dependency seata-spring-boot-starter result is ok(adapter: use seata-spring-boot-starter's autoConfiguration instead of spring-cloud-alibaba-seata-starter's autoConfiguration alibaba/spring-cloud-alibaba#1154).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- spring framework application with spring.xml with seata-all dependency and @EnableAutoDataSourceProxy(true or false) result is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments
...ng/src/main/java/io/seata/spring/annotation/datasource/SeataDataSourceBeanPostProcessor.java
Show resolved
Hide resolved
...ng/src/main/java/io/seata/spring/annotation/datasource/SeataDataSourceBeanPostProcessor.java
Show resolved
Hide resolved
spring/src/main/java/io/seata/spring/annotation/datasource/EnableAutoDataSourceProxy.java
Show resolved
Hide resolved
...oot-starter/src/main/java/io/seata/spring/boot/autoconfigure/properties/SeataProperties.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
This PR is totally the refactor of auto proxying of datasource.
Add a new annotation @EnableAutoDataSourceProxy.
User can choose to use CGLIB proxy or JDK proxy.
fix known problems,like
1.final class can't be proxied.
2.com.sun.proxy.$Proxy153 cannot be cast to com.zaxxer.hikari.HikariDataSource
etc.
Ⅱ. Does this pull request fix one issue?
fixex #2083 #2124
Ⅲ. Why don't you add test cases (unit test/integration test)?
I've done integration testing.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews