incubator-seata icon indicating copy to clipboard operation
incubator-seata copied to clipboard

spring mvc supports default modifiers, @GlobalTransactional only support public modifiers.

Open jsbxyyx opened this issue 1 month ago • 2 comments

Check Ahead

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

  • [ ] I am willing to try to implement this feature myself.

Why you need it?

@GlobalTransactional
@GetMapping("/")
Result index() {
  // do something
  return Result.success();
}

@GlobalTransactional not effective

How it could be?

No response

Other related information

No response

jsbxyyx avatar Nov 06 '25 07:11 jsbxyyx

I'd like to work on this issue. My idea is to change GlobalTransactionalInterceptorParser.existsAnnotation, clazz.getMethods() to clazz.getDeclaredMethods() and filter out private methods (as proxies can't intercept them). This would allow detection of annotations on protected and package-private methods.

contrueCT avatar Nov 06 '25 08:11 contrueCT

I'd like to work on this issue. My idea is to change GlobalTransactionalInterceptorParser.existsAnnotation, clazz.getMethods() to clazz.getDeclaredMethods() and filter out private methods (as proxies can't intercept them). This would allow detection of annotations on protected and package-private methods.

Whether this issue needs to be modified requires discussion among community members.

maple525866 avatar Nov 06 '25 08:11 maple525866