apache / apache/incubator-seata
@TwoPhaseBusinessAction annotation name attribute uniqueness assurance
Open
@PleaseGiveMeTheCoke is already working on this.
Since Nov 29, 2023.
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Ⅰ. Issue Description
name属性是由用户侧来保证唯一的,并且最终将会被当作资源id进行注册。但是即使有两个相同的名称,应用启动时也不会报告此错误,这将导致 TCCResourceManager 中 tccResourceCache 中的相同键被覆盖
name is guaranteed to be unique by the user side and will eventually be registered as a resource id. However, even if there are two identical names, this error will not be reported at startup, which would result in an overwrite of the same key in the tccResourceCache in the TCCResourceManager
Ⅱ. Describe what happened
If there is an exception, please attach the exception trace:
Just paste your stack trace here!
Ⅲ. Describe what you expected to happen
- 为什么不由我们替用户生成一个唯一的tcc资源名称,比如通过注解所在方法的method.toGenericString()方法,而不是让用户自己去在注解上指定和维护 why don't we generate a unique tcc resource name for the user, e.g. through the method.toGenericString() method of the method where the annotation is located, instead of letting the user specify and maintain it in the annotation themselves
- 在注册资源时增加判断,如果有相同名称的资源,通过抛出异常的方式告知用户是不是会比较好 add judgment when registering resources, if there is a resource with the same name, inform the user by throwing an exception is not better
Ⅳ. How to reproduce it (as minimally and precisely as possible)
- xxx
- xxx
- xxx
Minimal yet complete reproducer code (or URL to code):
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
- JDK version(e.g.
java -version): - Seata client/server version:
- Database version:
- OS(e.g.
uname -a): - Others:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.