Skip to content

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

Closed

Description

@spring-projects-issues

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:

Activity

  1. added
    in: data
    type: enhancement
    in: core
    on Jan 11, 2019
  2. modified the milestones: 6.x Backlog, 6.2.x on Mar 2, 2024
  3. self-assigned this
    on Mar 2, 2024
  4. jhoeller commented on Mar 4, 2024

    @jhoeller
    Contributor

    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.

  5. modified the milestones: 6.2.x, 6.2.0-M1 on Mar 4, 2024
  6. added a commit that references this issue on Mar 5, 2024
    30e75e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corein: datatype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions