[Erp5-report] r18549 - /erp5/trunk/products/ERP5Type/XMLMatrix.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 28 16:04:22 CET 2007


Author: vincent
Date: Fri Dec 28 16:04:22 2007
New Revision: 18549

URL: http://svn.erp5.org?rev=18549&view=rev
Log:
Fix a race condition which can lead cells to being uncataloged when cell range is modified.
It also fixes ZSQLCatalog from emmiting false "duplicate uid" warnings in this case.

Modified:
    erp5/trunk/products/ERP5Type/XMLMatrix.py

Modified: erp5/trunk/products/ERP5Type/XMLMatrix.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/XMLMatrix.py?rev=18549&r1=18548&r2=18549&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/XMLMatrix.py (original)
+++ erp5/trunk/products/ERP5Type/XMLMatrix.py Fri Dec 28 16:04:22 2007
@@ -285,6 +285,17 @@
             # Theses two lines are very important, if the object is renamed
             # then we must uncatalog the previous one
             o.unindexObject(path='%s/%s' % (self.getUrl() , object_id))
+            # Force a new uid to be allocated, because unindexObject creates
+            # an activity which will later delete lines from catalog based
+            # on their uid, and it is not garanted that indexation will happen
+            # after this deletion.
+            # It is bad to waste uids, but this data structure offers no
+            # alternative because cell id gives its index in the matrix,
+            # so reordering axes requires the cell id to change.
+            # XXX: It can be improved, but requires most of this file to be
+            # rewritten, and compatibility code must be written as data
+            # structure would most probably change.
+            o.uid = None
           o.reindexObject() # we reindex in case position has changed
                             # uid should be consistent
         else:




More information about the Erp5-report mailing list