Clearing DatabseCache doesn't work with Oracle backend.
|Reported by:||mmmnow@…||Owned by:||nobody|
|Component:||Core (Cache system)||Version:||1.6-beta-1|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
I have one row in my oracle cache table. I'm trying to clear it using standard django way:
from django.core.cache import cache cache.clear()
But it doesn't work! The row is still in my cache table.
So I run python manage.py sell and put some code from DatabaseCache.clear() method:
from django.db import connections table = connections['cache'].ops.quote_name('ws_cache_table') cursor = connections['cache'].cursor() cursor.execute('DELETE FROM %s' % table)
But it doesn't work either...
I don't get any exceptions thrown, my 'cache' connection is configured correctly in settings.py.
When I open SQL Developer and put
DELETE FROM ws_cache_table
Table gets truncated correctly.
On the other hand, when I add:
I get exception django.db.transaction.TransactionManagementError: This code isn't under transaction management thrown but the table is truncated now.
Change History (6)
comment:1 Changed 2 years ago by akaariai
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 Changed 2 years ago by akaariai
- Needs tests set
- Triage Stage changed from Unreviewed to Accepted
- Version changed from 1.5 to 1.6-beta-1