db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Dependency Manager in Derby
Date Wed, 19 Jul 2006 16:37:22 GMT
Mamta Satoor wrote:

> Hi,
> 
> Derby engine uses Dependency Manager to keep track of object
> dependencies and depedent objects get notified when the provider object has
> some notifications to send. I understand this at the high level but I
> wondered if someone for familiar with the implementation can provide some
> more details. For instance, there are methods like prepareToInvalide,
> makeInvalid and makeValid in the Dependent interface. What is the
> difference
> between prepareToInvalide and makeInvalid and in what order these methods
> get called?

I believe invalidation is a two stage process, first call
prepareToInvalidate() on all dependent objects and then makeInvalid() on
all objects. The idea is that the objects can reject and hence block the
invalidation event at the prepare time by throwing an exception. Only if
every dependent  has accepted the prepare does the actual invalidation
go ahead (makeInvalid).

This means that if the invalidation would fail, say due to a view
existing on a table being dropped, that there is no work to be rolled
back, which would be the case if the process was a single stage invalidate.


> Is there a difference between dependencies maintained in memory
> vs dependencies maintained over Derby reboots?

I don't think there is for invalidation, but I don't know when the
implementation deletes the rows in SYSDEPENDS corresponding to the
persistent dependencies. My guess is the implementation does it after
the makeInvalid call.

Dan.



Mime
View raw message