Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#211 closed defect (fixed)

Serializing class definition to XML needs to be optimized

Reported by: ronnielouie Owned by:
Priority: medium Milestone: 2.1
Component: Feature Service Version: 1.2.0
Severity: major Keywords:
Cc: External ID: 945237

Description

From Haris Kurtagic:

The problem was when executing MgServerDescribeSchema::DescribeSchema.

While transfering classes from FDO schema collection to MapGuide it is calling MgServerGetFeatures::GetMgClassDefinition in a for-loop for every class.

GetMgClassDefinition will seralize class to XML. But serialazing is done in a way that new temporary schema is created and than class is removed from original schema , put to temporary, temporary schema serialized and class returned to original class collection.

And if in that proccess another thread is doing describe schema it is error and exception and...

This is more obvious in a case of edits because after every edit ( insert/update/delete ) cache is cleared and DescribeSchema is called again.

I believe that describe schema should work differently, when doing "get class" it shouldn't change original schema list ( temporary removes class from list).

Change History (5)

comment:1 by ronnielouie, 17 years ago

It is rather cumbersome to get the original schema, remove the class, add to a temporary schema, serialize, remove from temporary schema, add back to original schema.

It seems the reason behind this is that a class can have only one parent object (schema) at a time. Because the class is moved to a temporary schema for serialization, it must be removed from the original parent schema before it can be added to the temporary one. Same goes for when it is returned back to the original.

A better approach would be to clone the feature class, then the clone can be manipulated (added to the temp schema, for writing out to xml) without touching the original schema.

comment:2 by rexszeto, 17 years ago

External ID: 945237

comment:3 by tomfukushima, 17 years ago

Milestone: 2.0

comment:4 by ronnielouie, 17 years ago

Resolution: fixed
Status: newclosed

Fix for http://trac.osgeo.org/mapguide/ticket/265 improved DescribeSchema performance such that class definition does not get serialized. Serializing to XML only occurs now when calling GetClassDefinition(). Updating the schema cache should no longer encounter conflict with GetClassDefinition. Since a class can only belong to one parent (schema), manipulating a temporary schema for serializing to xml is still required. Alternative solution of cloning the original schema and manipulating that for serialization actually results in degraded performance, so no further optimization is necessary.

Submitted http://trac.osgeo.org/mapguide/changeset/3135 to remove excessive ByteReader/ByteSink conversion.

comment:5 by ronnielouie, 17 years ago

Milestone: 2.1
Note: See TracTickets for help on using tickets.