Commit 2713e0aa authored by Vincent Pelletier's avatar Vincent Pelletier

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.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18549 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 544fcdb2
...@@ -285,6 +285,17 @@ class XMLMatrix(Folder): ...@@ -285,6 +285,17 @@ class XMLMatrix(Folder):
# Theses two lines are very important, if the object is renamed # Theses two lines are very important, if the object is renamed
# then we must uncatalog the previous one # then we must uncatalog the previous one
o.unindexObject(path='%s/%s' % (self.getUrl() , object_id)) 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 o.reindexObject() # we reindex in case position has changed
# uid should be consistent # uid should be consistent
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment