Dropping schema should drop L2 caches #7090

Open
opened 2026-01-22 15:44:28 +01:00 by admin · 1 comment
Owner

Originally created by @kiler129 on GitHub (Jan 15, 2023).

Feature Request

Q A
New Feature yes
RFC yes
BC Break no

Summary

While working in a dev environment I use a quick script which essentially:

  • Drops schema
  • Recreates schema
  • Imports fixtures

Since implemnting L2 in the application I noticed a strange behavior, where user data is stale. I tracked it to a simple fact that nothing in my "recreate test db" drops the caches. Adding the following to my script "solved" the problem:

./bin/console doctrine:cache:clear-entity-region --all
./bin/console doctrine:cache:clear-collection-region --all

Wouldn't it make sense to clear L2 caches on schema drop, or am I missing something?

Originally created by @kiler129 on GitHub (Jan 15, 2023). ### Feature Request | Q | A |------------ | ------ | New Feature | yes | RFC | yes | BC Break | no #### Summary While working in a dev environment I use a quick script which essentially: - Drops schema - Recreates schema - Imports fixtures Since implemnting L2 in the application I noticed a strange behavior, where user data is stale. I tracked it to a simple fact that nothing in my "recreate test db" drops the caches. Adding the following to my script "solved" the problem: ``` ./bin/console doctrine:cache:clear-entity-region --all ./bin/console doctrine:cache:clear-collection-region --all ``` Wouldn't it make sense to clear L2 caches on schema drop, or am I missing something?
admin added the New Feature label 2026-01-22 15:44:28 +01:00
Author
Owner

@andreybolonin commented on GitHub (Feb 14, 2023):

+1

@andreybolonin commented on GitHub (Feb 14, 2023): +1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7090