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

Transactional attribute is not resolved on CgLib proxies created by FactoryBeans [SPR-7448] #12106

spring-projects-issues opened this issue Aug 10, 2010 · 1 comment


Copy link

@spring-projects-issues spring-projects-issues commented Aug 10, 2010

Jan Novotný opened SPR-7448 and commented

When FactoryBean creates CgLib proxy via programmatic Spring proxy support (ie. ProxyFactory), @Transactional annotation on methods of original class are not picked by the transactional infrastructure. Reason is that the CgLib doesn't copies annotations on methods to the created final subclass and these annotations are not subject of inheritance.

See Jurgen Hoeller expression:

There is also open bug on CgLib - but I think it will never get resolved as the CgLib seems quite abadoned now:

There is very simple solution that would address this issue (documented in attached file).

Issue is described in this blog post in more detail.

Proposed solution is available at (see commentaries in referenced article):

Affects: 2.5.6


Issue Links:

  • #21216 Comprehensively cache annotated methods for interfaces and superclasses

Referenced from: commits 99733ae

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 11, 2010

Juergen Hoeller commented

This is a rather unusual scenario but you got a point there, so as of Spring 3.0.4, we introspect the superclass when given a CGLIB proxy as the target class. This has been implemented in the form of a ClassUtils.getUserClass call in AbstractFallbackTransactionAttributeSource.


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

Successfully merging a pull request may close this issue.

None yet
2 participants