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

Transaction manager cache fails to repopulate when multiple transaction managers defined [SPR-14609] #19177

Closed
spring-projects-issues opened this issue Aug 19, 2016 · 2 comments
Assignees
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 19, 2016

Tim Lenz opened SPR-14609 and commented

When TransactionAspectSupport is initialized, the transaction manager cache is populated by the setTransactionManager method. At this point there can be multiple TransactionInterceptor instances defined, each with its own cache, with no conflicts.

However, as soon as the transaction cache entry in TransactionAspectSupport is cleared by the garbage collector, the transaction manager bean is then looked up by type, which leads to a NoUniqueBeanDefinitionException if multiple transaction managers are defined in your application context.

This is a regression caused by #19080.


Affects: 4.3.2

Issue Links:

  • #19271 one beanfactory can not have more than one TransactionManager when low memory ("is duplicated by")
  • #19080 Transaction manager bean in TransactionInterceptor retained after JUnit test class completes
  • INT-4104 No qualifying bean of type [org.springframework.transaction.PlatformTransactionManager] is defined
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 24, 2016

Juergen Hoeller commented

This is the trigger to undo #19080 for the (still unreleased) 4.2.8, whereas we'll try to fix it retaining #19080 for 4.3.3.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 24, 2016

Juergen Hoeller commented

TransactionAspectSupport stores a given PlatformTransactionManager instance as a strong reference (again) while retaining the soft cache for retrieved PlatformTransactionManager beans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.