Commit 54faaf9d authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add a workaround for SQLDict.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2221 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3a24558c
...@@ -262,6 +262,12 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -262,6 +262,12 @@ class ZCatalog(Folder, Persistent, Implicit):
# This change must be reflected as soon as possible. # This change must be reflected as soon as possible.
get_transaction().commit() get_transaction().commit()
def finishHotReindexing(self, **kw):
"""
XXX: This is a workaround for CMFActivity.
"""
self.setHotReindexingState(state='finished', **kw)
def playBackRecordedObjectList(self, sql_catalog_id=None): def playBackRecordedObjectList(self, sql_catalog_id=None):
""" """
Play back must be a distinct method to activate... Play back must be a distinct method to activate...
...@@ -390,8 +396,6 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -390,8 +396,6 @@ class ZCatalog(Folder, Persistent, Implicit):
# XXX Commit transactions very often and use resolve_path to get objects instead of objectValues # XXX Commit transactions very often and use resolve_path to get objects instead of objectValues
# XXX This is not to be disturbed by normal user operations in the foreground. # XXX This is not to be disturbed by normal user operations in the foreground.
# XXX Otherwise, many read conflicts happen and hot reindexing restarts again and again. # XXX Otherwise, many read conflicts happen and hot reindexing restarts again and again.
LOG('hotReindex, skin_core.objectIds',0,self.portal_skins.erp5_core.objectIds())
LOG('hotReindex, skin_core.__dict__',0,self.portal_skins.__dict__)
#for path in self.Catalog_getIndexablePathList(): #for path in self.Catalog_getIndexablePathList():
for path in self.portal_skins.erp5_core.Catalog_getIndexablePathList(): for path in self.portal_skins.erp5_core.Catalog_getIndexablePathList():
object = self.resolve_path(path) object = self.resolve_path(path)
...@@ -431,11 +435,11 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -431,11 +435,11 @@ class ZCatalog(Folder, Persistent, Implicit):
# Exchange the databases. # Exchange the databases.
LOG('hotReindexObjectList', 0, 'Exchanging databases') LOG('hotReindexObjectList', 0, 'Exchanging databases')
self.activate(after_method_id=('reindexObject', 'playBackRecordedObjectList')).exchangeDatabases(source_sql_catalog_id, destination_sql_catalog_id, skin_selection_dict, sql_connection_id_dict) # XXX Never called by activity tool, why ??? XXX self.activate(after_method_id=('reindexObject', 'playBackRecordedObjectList', 'setHotReindexingState'), priority=5).exchangeDatabases(source_sql_catalog_id, destination_sql_catalog_id, skin_selection_dict, sql_connection_id_dict) # XXX Never called by activity tool, why ??? XXX
finally: finally:
# Finish. # Finish.
LOG('hotReindexObjectList', 0, 'Finishing hot reindexing') LOG('hotReindexObjectList', 0, 'Finishing hot reindexing')
self.activate(passive_commit=1, after_method_id='exchangeDatabases', priority=5).setHotReindexingState('finished') self.activate(passive_commit=1, after_method_id='exchangeDatabases', priority=5).finishHotReindexing()
if RESPONSE is not None: if RESPONSE is not None:
URL1 = REQUEST.get('URL1') URL1 = REQUEST.get('URL1')
......
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