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

Revisit storage of null attributes in AbstractFallbackTransaction/CacheAttributeSource [SPR-15513] #20072

Closed
spring-projects-issues opened this issue May 4, 2017 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented May 4, 2017

Juergen Hoeller opened SPR-15513 and commented

AbstractFallbackTransactionAttributeSource and AbstractFallbackCacheOperationSource add a 'null' entry to their attribute cache for every non-annotated method... even for every method of a totally non-annotated class. This is worth improving towards a class-level "not annotated" marker.


Affects: 5.0 RC1

Issue Links:

@spring-projects-issues spring-projects-issues added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
@jhoeller jhoeller modified the milestones: 6.x Backlog, 6.2.x Mar 2, 2024
@jhoeller jhoeller self-assigned this Mar 2, 2024
@jhoeller
Copy link
Contributor

jhoeller commented Mar 4, 2024

As of 6.2, we do not store null attributes during initial introspection at all but rather just on first invocation of a non-transactional method on a proxy (which can only happen if other methods on the same class are transactional/cacheable). This is accomplished through new hasTransaction/CacheAttribute methods on the SPI which internally indicate no caching in the fallback source classes. As a result, typically only actual transactional/cacheable methods are stored in the cache now, plus potentially some related methods invoked through the same proxies.

For consistency, we also have isCandidateClass support on JCacheOperationSource now which was previously missing there next to the existing support on the other fallback source classes.

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) in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants