[mapguide-users] MapGuide crash on null search of SDF & SQL Joined Feature Class

smamap andre at relajada.com
Sun Nov 4 17:30:31 EST 2007



I had the same problem.  Searches work fine on non-joined Feature Classes. 
Searches work fine on joined Feature Classes as long as the result is not
empty.  An empty result on a joined feature class causes the MG0S1.2
MapGuide service to crash.  My search field is in the primary source.

In my case, it is a simple one-to-one join with all the same records in both
the default Feature Class and the join Feature Class.  I have worked around
the problem by searching against the default Feature Class then using the
results with the joined Feature Class to have access to all the fields. 
Crazy, no?

Here is the original statement that causes the crash:
		
$featureReader = $featureService->SelectFeatures($resId,
$layer->GetFeatureClassName(), $queryOptions);

Since all of my layers using joined Feature Classes take the default name of
xxxJoin, I'm able to get the default Feature Class name by stripping 'Join'
off the end of the name:


		$tempFeatureClassName = $layer->GetFeatureClassName();
		$testJoin = substr($tempFeatureClassName, strlen($tempFeatureClassName) -
4, 4);
		if ($testJoin == "Join")
			$tempFeatureClassName=
substr($tempFeatureClassName,0,strlen($tempFeatureClassName)-4);
		$featureReader = $featureService->SelectFeatures($resId,
$tempFeatureClassName, $queryOptions);

A better PHP programmer could do this more elegantly.
-- 
View this message in context: http://www.nabble.com/How-to-check-for-an-expired-session--tf4390559s16610.html#a13578581
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list