[Erp5-dev] Forcing to wait reindexing

Guillaume MICHON guillaume.michon at e-asc.com
Fri Jun 24 17:39:51 CEST 2005


Hi all,

Romain said me Nexedi staff was removing manual immediateReindexObject() 
calls to speed up the system.
So I need to find a solution to a problem about this in DeliveryBuilders 
(Romain has the same problem).

A DeliveryBuilder manipulates Simulation Movement properties, and can 
make them divergent. But the connected Delivery uses the catalog to know 
if the Simulation Movement is divergent. And this divergence test is 
made in an interaction workflow which is called on the delivery edit() 
method.

The problem is the following :
1) The DeliveryBuilder changes Simulation Movement properties
2) edit() is called on the delivery, and the divergence workflow makes a 
test, but the Simulation Movement has not been reindex yet, so the 
movement.is_divergent SQL column is not up to date.

I see two solutions :
- Add some immediateReindexObject : it is bad.
- Find something to make the divergence workflow wait until the 
Simulation Movements are reindexed.

The second solution can be made by using the 'after_method_id' argument 
when calling delivery.activate().edit(), but it is not so good I think, 
because "immediateReindexObject" is a massively called method in activities.
Have you some ideas ?

Regards,
Guillaume



More information about the Erp5-dev mailing list