Skip to content

Migrate DbCache use to DatabaseCache#5472

Merged
labkey-adam merged 36 commits intodevelopfrom
fb_dbcache
May 20, 2024
Merged

Migrate DbCache use to DatabaseCache#5472
labkey-adam merged 36 commits intodevelopfrom
fb_dbcache

Conversation

@labkey-adam
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam commented May 2, 2024

Rationale

DbCache has been an anti-pattern for many years since it uses a very inefficient invalidation mechanism (the entire cache is cleared on every insert, update, or delete). It's time to eliminate it.

Changes

  • Migrate experiment runs cache DbCache -> DatabaseCache
  • Migrate participant cache DbCache -> DatabaseCache
  • Migrate StudyCache/QueryHelper DbCache -> DatabaseCache
  • Move various specimen methods study -> specimen. deleteAllSpecimenData() move is needed to allow explicit invalidation of specimen helpers; other moved methods aren't related to caching, but there's no reason for them to stay in study.
  • Implement equals() and hashCode() on many classes to accommodate cache verification.

Note: This PR leaves DbCache and a large amount of validation & logging code in place. While many test suites have been run, my preference is to merge the verification code to develop and run all the tests with it in place for a few days, then follow up with a PR that removes DbCache, validation, logging, etc.

@labkey-adam labkey-adam marked this pull request as draft May 4, 2024 07:04
@labkey-adam labkey-adam marked this pull request as ready for review May 15, 2024 16:12
@labkey-adam labkey-adam linked an issue May 20, 2024 that may be closed by this pull request
13 tasks
@labkey-adam labkey-adam self-assigned this May 20, 2024
@labkey-adam labkey-adam merged commit 815cf3b into develop May 20, 2024
@labkey-adam labkey-adam deleted the fb_dbcache branch May 20, 2024 22:00
@labkey-adam labkey-adam removed a link to an issue May 24, 2024
13 tasks
@labkey-adam labkey-adam linked an issue May 24, 2024 that may be closed by this pull request
13 tasks
labkey-tchad pushed a commit to LabKey/customModules that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LabKey CI] Eliminate DbCache use

2 participants