$order cached? Delete Cache of SQL query/$order called in an API.
Hello Intersystems-Community,
I build an API and there I use $order to get the Data from my Globals.
When I first time use that API it's get an error (504 Gateway-Timout > 60 Sec.).
After 2 reloads it works with a loading time of 2 Sec.! Sounds for me like the $order is cached and it works faster. Is it true $order will be cached?
When it works, I only get the error at the next day. So it's very hard to reproduce that error. Is it possible to delete the cache for $order?
Example:
set a = "" for { set a = $order(^SD031S("0","7",x,a)) if (a = "") {quit} set b = "" for { set b = $order(^SD031S("0","7",x,a,b)) if (b = "") {quit} if ($piece($get(^SD031("0",a,b,1),""),Y,9) = x) { set c = a set d = "" for { set d = $order(^FA060S("0","22",c,b,c,d)) if (d = "") {quit} if ($piece($get(^FA060("0",c,d,2),""),Y,25) = b) { #dim innerObject = ##class(%ZEN.proxyObject).%New() set articleList = ##class(test.test).getArticle("SB02906",c,d,"0","1") set dataLength = 0 set dataLength = artcleList.Count() set innerObject.d = d set innerObject.c = c set innerObject.dataExist = $case(dataLength, 0:0, :1) do responseList.Insert(innerObject) } } } } } } set object.response = responseList set object.result = $$$YES set object.message = "" set x = ##class(%ZEN.Auxiliary.jsonArrayProvider).%WriteJSONStreamFromObject(.json,object) return $$$OK
Thanks and Best regards
Florian Hansmann