-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Nested transactions are stuck #925
Comments
Nested transactions aren't permitted in mysql: https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html |
The question is about API of finagle-mysql that allows to make stuff like that. I'm figured out why it's stuck. The reason is session pool with max size 1. If increase max size of session poll up to N then N number of nested transaction are allowed. In fact all transactions are just parallel and don't share any state. The second problem is deadlocks. If you update row in parent transaction and then try to update the same row in child transaction they will be wait each other. I understand that it's difficult to ban expression like above in compile time. But maybe better if nested transactions will be raise some exception in runtime? |
gotcha, yeah we can make more clear that we don't support nested transactions via the api. to clarify, when you made those changes, you were able to get nested transactions working? |
I have a test like this:
This is minimal example, but it reflects what I actually've faced. I knows that I'm shouldn't do that in general. But in large code base with a bunch of Dao and Repositories is really hard to catch this case.
Is this usage of client valid?Is it a bug?
The text was updated successfully, but these errors were encountered: