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

TransactionTemplate leaks transactions when TransactionCallback propagates undeclared checked exception [SPR-6361] #11027

Closed
spring-projects-issues opened this issue Nov 16, 2009 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 16, 2009

Marat Radchenko opened SPR-6361 and commented

TransactionTemplate doesn't neither commit nor rollback on checked exception, causing leakage.

See attached testcase.


Affects: 2.5.6

Attachments:

Issue Links:

Referenced from: commits a741410

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Fixed through catching Exception now. Note that a checked exception will be converted into an UndeclaredThrowableException since we technically can't rethrow an undeclared checked exception ourselves. (Frankly, it's quite odd that Java allows for it from reflectively called constructors.)

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Marat Radchenko commented

Actually you can rethrow it, using the same technic i used to throw it in first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants