Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
10.11.11
-
Unknown
-
Description
When modifying a xclass field the class migrator wake up to do necessary modification to corresponding xobjects. Problem is that the current implementation can takes hours when there is a lot of xobject of that xclass and blocks the class save in the meantime.
The object update is very important so we can't just remove it but there is probably ways to work on optimizing it.
Reproduction steps
- create a class (e.g., MyClass.WebHome)
- create a lot of page each containing an object from the new class
- edit the class and add a new field
- wait
expected
- the change is performed "quickly"
Actual
- adding the new field takes 27 seconds
Notes
This is worsened by the fact that changes on the XObject are performed as soon as the field is added.
Snippet to create the classes
{{groovy}} for(index in 1..3000){ key = "Test"+index udoc = xwiki.getDocument("Space."+key) uobj = udoc.getObject("MyClass.WebHome", true) uobj.set("field1", key) ## assuming MyClass.WebHome has a "field1" field print("* Created *" + udoc.key + "*\n") udoc.save() } {{/groovy}}
You can find attached the result of a profiling after adding a new field to MyClass.WebHome