query.task intermitent error: Unable to complete operation

2402
4
Jump to solution
12-19-2012 12:08 PM
jaromzenger
New Contributor
Hi

I have a query task that intermitently (more like every other time) throws an error message: {"error":{"code":400,"message":"Unable to complete operation.","details":[]}}

I have not seen this error using the query.task until we installed ArcGIS Server 10.1 with service pack 1. I am using the API version 3.2.

Is anyone else having the same problem? Is it a server setting that is causing this? Am I missing something in my code? Is there a fix? Is this a bug?

PLease help!

                query = new esri.tasks.Query();         query.returnGeometry = true;         query.outFields = ["*"];         query.where = "parcel_id like '" +searchText+"%'";         query.outSpatialReference = map.spatialReference;         queryTask.execute(query, showResults2,function showErr(){         console.log('error in query execution');} );
0 Kudos
1 Solution

Accepted Solutions
RahulMetangale1
Occasional Contributor II
I found a workaround to the issue:
1. you can do a request in post
2. pass new time stamp with the query
var dirty = (new Date()).getTime(); var query = new esri.tasks.Query(); query.where = "MyField= " + MyValue+ " AND " + dirty + "=" + dirty; 


And here is the bug id:
[ NIM086349 - Alternate Query (Get) requests fail in Version 10.1 SP1 ]

View solution in original post

0 Kudos
4 Replies
jaromzenger
New Contributor
In playing with it more I've noticed that it gives me the error every other time I submit the query. It is the exact same query each time but errors out every other time. I have also tried the identify task and find task and neither are throwing an error. Strange.
Anyone willing to wade in on what may be causing this?
0 Kudos
RahulMetangale1
Occasional Contributor II
Yes. I have also noticed the same after installing service pack 1 for 10.1. Looks like a bug to me.
0 Kudos
RahulMetangale1
Occasional Contributor II
I found a workaround to the issue:
1. you can do a request in post
2. pass new time stamp with the query
var dirty = (new Date()).getTime(); var query = new esri.tasks.Query(); query.where = "MyField= " + MyValue+ " AND " + dirty + "=" + dirty; 


And here is the bug id:
[ NIM086349 - Alternate Query (Get) requests fail in Version 10.1 SP1 ]
0 Kudos
jaromzenger
New Contributor
Thanks, Rahul_M.

That work around seems to do the trick.

I also found the following thread detailing the same issuse and on there is a link to the bug report.

http://forums.arcgis.com/threads/73456-new-problem-REST-query-10.1-every-other-request-fails-(400-un...
0 Kudos