Skip to content
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

Handle inTransaction throws in finally block #2343

Closed
andru47 opened this issue May 4, 2023 · 3 comments · Fixed by #2344
Closed

Handle inTransaction throws in finally block #2343

andru47 opened this issue May 4, 2023 · 3 comments · Fixed by #2344

Comments

@andru47
Copy link

andru47 commented May 4, 2023

In the finally block of the Handle inTransaction, the isolation level is reset to the initial value.
If the transaction handler throws an error and resetting the isolation error throws an error as well, the error thrown by the transaction handler is ignored so we lose a lot of context about why the transaction actually failed.
Adding a catch block and storing the initial exception would allow adding suppressed exceptions in the finally block and hence we can display both exceptions to the user.

@stevenschlansker
Copy link
Member

Thanks for pointing this out. I think it's even easier to fix by using try-with-resources.

@andru47
Copy link
Author

andru47 commented May 24, 2023

Hi @stevenschlansker, I was wondering when this will be released.

@stevenschlansker
Copy link
Member

@andru47 , sorry for the delay, our release process was broken for a bit. 3.38.3 should be out now with your fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants