You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Yip Ng <yi...@gmail.com> on 2006/09/25 23:19:52 UTC
Data Dictionary Cache question
Hi
I am looking through the data dictionary code and I am wondering why the
system needs to clear *ALL* the data dictionary caches (table descriptors,
etc.) at startWriting(), what is the reason behind this? Wouldn't clearing
just the "affected" descriptor(s) in the DDL's constant action enough?
Yip
Re: Data Dictionary Cache question
Posted by Mamta Satoor <ms...@gmail.com>.
Yip,
My guess is that startWriting clears all the data dictionary caches so
that individual sql statement implementations don't have to worry about
dealing with keeping the cache clean. Because if a statement missed cleaning
the cache (like it happened for ALTER TABLE ADD COLUMN) then we could end up
with bugs like DERBY-1847. So, I guess for code maintainability, Derby might
have chosen to cleanup all the caches. I don't know why this logic is not
applied to permission cache though. startWriting() does not cleanup the
permission cache and looks like it is expected to be done by the inidividual
sql statements whereever necessary.
But like I said, this is just a theory I deducted from the current
implementation. Someone else might have more concrete answer.
Mamta
On 9/25/06, Yip Ng <yi...@gmail.com> wrote:
>
> Hi
>
> I am looking through the data dictionary code and I am wondering why
> the system needs to clear *ALL* the data dictionary caches (table
> descriptors, etc.) at startWriting(), what is the reason behind this?
> Wouldn't clearing just the "affected" descriptor(s) in the DDL's constant
> action enough?
>
> Yip
>
>