You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "wanghongzhou (via GitHub)" <gi...@apache.org> on 2024/05/21 08:30:25 UTC

[PR] optimize: Add support for configuring exposeProxy in GlobalTransactionScanner [incubator-seata]

wanghongzhou opened a new pull request, #6566:
URL: https://github.com/apache/incubator-seata/pull/6566

   <!-- Please make sure you have read and understood the contributing guidelines -->
   
   - [x] I have registered the PR [changes](../changes).
   
   ### Ⅰ. Description of this PR
   
   This PR introduces changes related to the `exposeProxy` attribute handling.
   
   ### Ⅱ. Does this pull request fix one issue?
   
   Yes, this pull request addresses the issue reported in [6562](https://github.com/apache/incubator-seata/issues/6562)
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)?
   
   As this PR is primarily about configuring the `exposeProxy` attribute, which is more of a configuration change rather than functional changes in the code logic, adding test cases does not apply directly.
   
   ### Ⅳ. Describe how to verify it
   
   To verify the changes introduced by this PR, follow these steps:
   1. Review the modifications made in the codebase, particularly the addition of the `exposeProxy` attribute.
   2. Ensure that the new attribute is properly configured and its value is correctly reflected in the relevant components.
   3. Validate the behavior of the application to confirm that the `exposeProxy` attribute is functioning as expected.
   
   ### Ⅴ. Special notes for reviews
   
   The changes made in this PR primarily focus on adding support for configuring the `exposeProxy` attribute. It ensures that the `exposeProxy` setting is correctly applied in the context of the `GlobalTransactionScanner` to facilitate the proper functioning of annotations like `@GlobalTransactional`. The `exposeProxy` attribute allows obtaining the proxy object, enabling annotations to function correctly in scenarios where method calls within the same class are involved.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: Add support for configuring exposeProxy in GlobalTransactionScanner [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #6566:
URL: https://github.com/apache/incubator-seata/pull/6566#discussion_r1607882790


##########
changes/zh-cn/2.x.md:
##########
@@ -138,6 +138,7 @@
 - [[#6540](https://github.com/apache/incubator-seata/pull/6540)] 排除  com.google.guava:listenablefuture 依赖
 - [[#6549](https://github.com/apache/incubator-seata/pull/6549)] 支持macos arm架构单测
 - [[#6558](https://github.com/apache/incubator-seata/pull/6558)] y移除 mysql-connector-java 依赖
+- [[#6562](https://github.com/apache/incubator-seata/pull/6562)] 支持GlobalTransactionScanner类中exposeProxy属性的配置

Review Comment:
   ```suggestion
   - [[#6566](https://github.com/apache/incubator-seata/pull/6566)] 支持GlobalTransactionScanner类中exposeProxy属性的配置
   ```



##########
changes/en-us/2.x.md:
##########
@@ -140,6 +140,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#6540](https://github.com/apache/incubator-seata/pull/6540)] exclude com.google.guava:listenablefuture
 - [[#6549](https://github.com/apache/incubator-seata/pull/6549)] macos workflow support arm testing
 - [[#6558](https://github.com/apache/incubator-seata/pull/6558)] remove mysql-connector-java from pom.xml
+- [[#6562](https://github.com/apache/incubator-seata/pull/6562)] Add support for configuring exposeProxy in GlobalTransactionScanner

Review Comment:
   ```suggestion
   - [[#6566](https://github.com/apache/incubator-seata/pull/6566)] Add support for configuring exposeProxy in GlobalTransactionScanner
   ```



##########
seata-spring-autoconfigure/seata-spring-autoconfigure-client/src/main/java/org/apache/seata/spring/boot/autoconfigure/properties/SeataProperties.java:
##########
@@ -51,6 +51,12 @@ public class SeataProperties {
      * Whether use JDK proxy instead of CGLIB proxy
      */
     private boolean useJdkProxy = false;
+    /**
+     * Whether to expose the proxy object through AopContext.
+     * Setting this to true allows AopContext.currentProxy() to be used to obtain the current proxy,
+     * which can be useful for invoking methods annotated with @GlobalTransactional within the same class.
+     */
+    private boolean exposeProxy = false;

Review Comment:
   https://github.com/apache/incubator-seata/tree/2.x/script/client/spring
   Please add the configuration example here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: Add support for configuring exposeProxy in GlobalTransactionScanner [incubator-seata]

Posted by "wanghongzhou (via GitHub)" <gi...@apache.org>.
wanghongzhou commented on PR #6566:
URL: https://github.com/apache/incubator-seata/pull/6566#issuecomment-2122263192

   > /home/runner/work/incubator-seata/incubator-seata/compatible/src/main/java/io/seata/spring/annotation/GlobalTransactionScanner.java:[97,46] incompatible types: int cannot be converted to boolean
   
   Resolved
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: Add support for configuring exposeProxy in GlobalTransactionScanner [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on PR #6566:
URL: https://github.com/apache/incubator-seata/pull/6566#issuecomment-2122080751

   /home/runner/work/incubator-seata/incubator-seata/compatible/src/main/java/io/seata/spring/annotation/GlobalTransactionScanner.java:[97,46] incompatible types: int cannot be converted to boolean


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org