[Zope3-dev] Re: The Proposed Catalog Sprint Agenda is available

Steve Alexander steve@cat-box.net
Thu, 14 Feb 2002 21:02:04 +0000


Jim Fulton wrote:
> Jim Fulton wrote:
> 
>>The Proposed Catalog Sprint Agenda is available. I propose to
>>start building out the architecture proposed in Gary Poster's
>>ObjectHub proposal.


I'm largely happy with the proposal, and I'm looking forward to working 
on it next week.

The proposal says nothing about when indexing occurs, and I guess this 
is the responsibility of some other component.
(By indexing, I'm talking about both cataloging and creating links.)

However, one thing I've found extremely useful from my work with 
ZPatterns / TransactionAgents is to have indexing performed right at the 
end of a (sub-)transaction, just before the TPC begins.

There are two main advantages to this:

   * Separating the desire to be indexed from the process of indexing

   * Keeping the data that is indexed consistent with the state of the
     data, when viewed outside the transaction the index occured in.

Phillip Eby's solution was to have two queues, one for manipulating links,
and one for recording metadata+index data. These are called "rule agents"
and "indexing agents" respectively.

During a transaction, the application can enqueue actions to either of 
the queues.

Just before a transaction is to enter TPC begin, all the rule agents are 
run, and then all the indexing agents are run.

These agents can veto actions by raising an exception, which will (in 
Zope) roll-back the transaction.

The logic gets a bit more complex when you take into account 
subtransactions.

I implemented this system for Zope2 as the TransactionAgents product.


As I said above, I guess all this lies outside the scope of the current 
proposal. However, I find the advantages compelling.

--
Steve Alexander