Select to view content in your preferred language

10.2 Sever and relationship queries

1034
4
05-21-2014 02:25 PM
raffia
by
Deactivated User
Hi all;

Since the servers were updated to 10.2.2, all the queries freaked out...so anyways I read the docs on ESRI's help page about the changes required, for SQL injection prevention and things like that.

So in my code, I really dont think I have any software specific codes in relation to the queries. Anyway I have a bunch of points, and each has relationship with other tables and features, this is for landmark types, media, address...etc. So I was getting the 2023 error initially when the queries were being called, I explicitly made the queries to use GET instead of POST and useAMF is false. The errors still are there, sometimes they show up, other times they dont.

[RPC Fault faultString="Error performing query related records operation" faultCode="500" faultDetail=""]

You can see the beta app here:
http://www.digitaleg.com/Digital_Egypt/EGIPA/Map_En.html

This is strange because the points are loaded initially based on a relationship query, but no errors, but the error is generated when further relationship queries are sent. Here is a block of the relevant code, trimmed as much as possible:

//This function sometimes works and sometimes doesnt. But the points always load. It is the popup error that sometimes shows and sometimes doesnt.
private function doQueryLandmarkMensHair(event:Event) : void
{ landmarkTypeQueryTask = null;
    
    landmarkTypeQueryTask = new QueryTask; 
    landmarkTypeQueryTask.useAMF = false;
    var landmarksRelationshipQuery:RelationshipQuery = new RelationshipQuery();            
    landmarksRelationshipQuery.objectIds = [182]; 
    landmarksRelationshipQuery.relationshipId = 3; 
    
    landmarksRelationshipQuery.returnGeometry = true; 
    landmarksRelationshipQuery.outSpatialReference = myMap.spatialReference;
    landmarkTypeQueryTask.method = URLRequestMethod.GET;
    landmarkTypeQueryTask.url = "url here";
    landmarkTypeQueryTask.executeRelationshipQuery(landmarksRelationshipQuery, new AsyncResponder(onLandmarksMensHairResult, onRelationshiptQueryFault, null));
}



//This function sometimes works and sometimes doesnt. But the points always load. It is the popup error that sometimes shows and sometimes doesnt.
private function onLandmarksMensHairResult( result:Object, token:Object = null ) : void
{       
    landmarkResultsCount = result[182].features.length; 


    landmarksGraphicsLayer.clear();


         for each (myLandmarksGraphic in result[182].features)
    {        
        selectedLandmarkObjectID = myLandmarksGraphic.attributes.OBJECTID;        
        landmarksGraphicsLayer.add(myLandmarksGraphic);    
        landmarksADGVar.landmarksADG.dataProvider = result[182].attributes;    
    }        
}

<esri:GraphicsLayer id="landmarksGraphicsLayer" click="landmarksClickHandler(event);"/>     

//The below function is when the error is generated from one of the relationship queries
�??            private function launchLandmarkDetails():void

{
    landmarkInfoQuery.relationshipId = 5; 
    landmarkInfoQuery.outFields = ["*"]; 
    landmarkInfoQuery.returnGeometry = true; 
    landmarkInfoQuery.outSpatialReference = myMap.spatialReference;
    
    landmarkPanoramaQuery.relationshipId = 0; 
    landmarkPanoramaQuery.outFields = ["MediaEName" , "L5" , "L2"]; 
    landmarkPanoramaQuery.returnGeometry = true; 
    landmarkPanoramaQuery.outSpatialReference = myMap.spatialReference;    
    landmarkPanoramaQuery.definitionExpression = "MediaType = 2";
    
    landmarkPicturesQuery.relationshipId = 2; 
    landmarkPicturesQuery.outFields = ["MediaEName" , "L4" , "L1"]; 
    landmarkPicturesQuery.returnGeometry = true; 
    landmarkPicturesQuery.outSpatialReference = myMap.spatialReference;    
    landmarkPicturesQuery.definitionExpression = "MediaType = 1";
    
    queryTaskLandmarkPanorama.method = URLRequestMethod.GET; 
    queryTaskLandmarkPanorama.useAMF = false;
    queryTaskLandmarkPanorama.url = "url";
    queryTaskLandmarkPanorama.executeRelationshipQuery(landmarkPanoramaQuery, new AsyncResponder(landmarkRVResult, onRelationshiptQueryFault, null));
    
    queryTaskLandmarkInfo.method = URLRequestMethod.GET; 
    queryTaskLandmarkInfo.useAMF = false;
    queryTaskLandmarkInfo.url = "url";
    queryTaskLandmarkInfo.executeRelationshipQuery(landmarkInfoQuery, new AsyncResponder(landmarkInfoResult, onRelationshiptQueryFault, null));    
    
    queryTaskLandmarkPictures.method = URLRequestMethod.GET; 
    queryTaskLandmarkPictures.useAMF = false;
    queryTaskLandmarkPictures.url = "url";
    queryTaskLandmarkPictures.executeRelationshipQuery(landmarkPicturesQuery, new AsyncResponder(landmarkPicturesResult, onRelationshiptQueryFault, null));        

    function landmarkInfoResult(landmarkInfoResultVar:Object, infoToken:Object = null):void
    {
//do some stuff, read the data
}

function landmarkRVResult(landmarkPanoramaResultVar:Object, mediaToken:Object = null):void
    {
//do some stuff, read the data
}

function landmarkPicturesResult(landmarkPicturesResultVar:Object, mediaToken:Object = null):void
    {
//do some stuff, read the data
}
}



Any ideas guys?
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Raffi,

   The first thing to check when you upgrade ArcGIS Server and have a query issue is the field names. I has been my experience that there are sometimes changes (after an upgrade) that occur to field names. I would carefully leter by leter check the case of the fields you are using in the outfields array against your REST service directory.
0 Kudos
RaymondHuang
Regular Contributor
Hi Raffi,

I have opened your beta app in multiple browsers and played around with it, but have not faced any errors. Could you try to reproduce the error on your end and share the server log on what's happening during the occurrence of the error? I believe that will give us some insights. Hope that helps.

Regards,
Raymond
0 Kudos
raffia
by
Deactivated User
Hello guys, thanks for the replies.

Robert:

I did check the filed name, no changes that I observed, The weird thing is that almost half the time, no errors are generated and everything goes smoothly, all fields are returned, nothing is blank or null, and half the other time, all hell breaks loose. What is weirder is it doesn't seem random, meaning everything would work for hours at a time, then not work for more hours at a time. Driving me nuts. For example, right now, everything is working great, usually things start to freak out after around 5 PM EGY time, am sure this observation doesn't make any sense, but it is what is happening in the last few days.

Raymond:

Unfortunately I don't have direct access to the servers, so it might be challenging to get the error logs.
0 Kudos
raffia
by
Deactivated User
The errors are back full force!!
0 Kudos