[fdo-trac] #637: Can't get the PropertyName against the Sql
Server Spatial
FDO
trac_fdo at osgeo.org
Thu Apr 8 01:30:07 EDT 2010
#637: Can't get the PropertyName against the Sql Server Spatial
-------------------------------+--------------------------------------------
Reporter: hubu | Owner: hubu
Type: defect | Status: new
Priority: blocker | Milestone: 3.5.0
Component: SQLServer Spatial | Version: 3.5.0
Severity: 2 | Resolution:
Keywords: | External_id: 1291809
-------------------------------+--------------------------------------------
Comment (by hubu):
[Problem]:
In MapGuide Studio, when connect to SQLSERVER Spatial, and preview the
features in the feature editor, we will get a fdo exception "Invalid
Stream Header". This problem only happens on Sqlserver spatial provider.
[Reason]:
In the FdoRdbmsDataReader, the GetPropertyName functon is defined like
this:
virtual FdoString* GetPropertyName(FdoInt32 index)
{
EXECUTE_METHOD(GetPropertyNameForDataReader( index ));
}
When the FdoRdbmsDataReader::GetPropertyName() is invoked, actually the
FDORbmbsFeatureReader::GetPropertyNameForDataReader() will be executed.
And the FDORbmbsFeatureReader::GetPropertyNameForDataReader() is a virtual
mothod.
The FdoRdbmsSqlServerOptimizedAggregateReader derived from
FdoRdbmsFeatureReader. The problem is
FdoRdbmsSqlServerOptimizedAggregateReader doesn't override the
GetPropertyNameForDataReader(FdoInt32 index) mothod.
In this case, the FDORbmbsFeatureReader::GetPropertyNameForDataReader() is
executed instead of the
FdoRdbmsSqlServerOptimizedAggregateReader::GetPropertyNameForDataReader().
The method FDORbmbsFeatureReader::GetPropertyNameForDataReader() will
invoke the FDORbmbsFeatureReader::GetPropertyCount() mothod to initialize
the array mColList before using this array. But the
FDORbmbsFeatureReader::GetPropertyCount() is overrided by the
FdoRdbmsSqlServerOptimizedAggregateReader::GetPropertyCount(), in this
override function, the mColList is not initialized. Then the execption
happens when read the uninitialized array mColList.
[Solution]:
Override the GetPropertyNameForDataReader(FdoInt32 index) mothod in the
FdoRdbmsSqlServerOptimizedAggregateReader.
TESTING PERFORMED:
Make sure the SQL Server spatial feature preview successfully.
--
Ticket URL: <https://trac.osgeo.org/fdo/ticket/637#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list