-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
TransactionalTemplate#execute doesn't call GlobalTransactionContext#clean, which result in leaking ThreadLocal variables #313
Comments
Could you please give a reproducing steps for this issue? |
|
I use it in spring boot enviroment,this is happend too,because tomcat use thread pool. |
@slievrly Please check section [fescar-test-nestedsession] in my project Inner transaction will commit the outer transaction, though they are the same transaction. This is wrong because the commit or rolllback of the global transaction should be done by the outer transaction. When the outer transaction come back to rollback, the undo_log has already been cleared by the inner transaction. |
@tankilo nest inner Trx commit/rollback cause the whole Trx commit/rollback? |
Ⅰ. Issue Description
TransactionalTemplate#execute doesn't call GlobalTransactionContext#clean, which result in leaking ThreadLocal variables
Ⅱ. Describe what happened
First method call
Second method call, the xid that leaked by the first method call can still be achieved!!!
Ⅲ. Describe what you expected to happen
After exiting method TransactionalTemplate#execute, any ThreadLocal variables of the global transaction which are newly created by this method call should be cleared.
Just like Spring JDBC, the outside transaction aop method should clean up the resources that it created.
Ⅳ. How to reproduce it (as minimally and precisely as possible)
I have a project fescar-test, you need to edit Simple.java first to bypass #312
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
The text was updated successfully, but these errors were encountered: