I know that query rules limit to the amount of memory that can be returned by a

I know that query rules limit to the amount of memory that can be returned by a single query rule, but is there anylimit to the amount of memory that can be returned by a query entity? I want to say no, however, I've ran into a situation where a query entity will run into an error when trying to return all data from a table. The query entity 's error is simply "An error occurred while retrieving the data.", while trying to receive all the data from the table using a query rule it's a memory thereshold error. This makes me wonder if query entity has any limit on memory. Can someone shed some light on this?

OriginalPostID-166685

OriginalPostID-166685

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    Can you check the stacktrace in the logs at the time error occurred?
  • 0
    Certified Lead Developer
    Also if you are limiting the resultset by adding conditions in your query entity - are you able to get results or getting the same error.
  • I haven't tested the limits of query rules myself, but I can tell you I have an a!queryEntity() call right now that is returning 2,091,400 items successfully.
  • @AkshayaN I can ask Platform if I have access to logs or if they can provide me with stacktrace

    @ketanp If I limit the result set by filtering or by batch size I am able to get results, so long as the filter is specific enough, or the batch size is small enough. It appears that filters that work, also work for query rule, and filters that do not also do not work for query rules
  • @AkshayaN I am able to view logs. Relevant stacktrace (as much as will fit):
    at function a!queryEntity [line 11]: An error occurred while retrieving the data. (APNX-1-4198-000)
    \tat com.appiancorp.process.expression.ExpressionRuntimeException.(ExpressionRuntimeException.java:70)
    \tat com.appiancorp.core.expr.exceptions.AppianScriptException.(AppianScriptException.java:25)
    \tat com.appiancorp.core.expr.exceptions.ParseException.(ParseException.java:20)
    \tat com.appiancorp.core.expr.exceptions.FunctionException.(FunctionException.java:13)
    \tat com.appiancorp.core.expr.tree.FunctionCall.evalEvaluable(FunctionCall.java:329)
    \tat com.appiancorp.core.expr.tree.FunctionCall.eval(FunctionCall.java:392)
    \tat com.appiancorp.core.expr.Tree.eval0(Tree.java:214)
    \tat com.appiancorp.core.expr.Tree.eval(Tree.java:210)
    \tat com.appiancorp.core.expr.rule.Rule.evalBody(Rule.java:831)
    \tat com.appiancorp.core.expr.rule.Rule.eval(Rule.java:411)
    \tat com.appiancorp.core.expr.rule.Rule.eval(Rule.java:320)
    \tat com.appiancorp.core.expr.rule.Rule.evalWithMetrics(Rule.java:308)
    \tat com.appiancorp.core.expr.rule.Rule.eval(Rule.java:297)
    \tat com.appiancorp.core.expr.tree.FreeformRule.eval(FreeformRule.java:72)
    \tat com.appiancorp.core.expr.tree.FreeformRule.eval0(FreeformRule.java:49)
    \tat com.appiancorp.core.expr.Tree.eval(Tree.java:210)
    \tat com.appiancorp.core.expr.tree.Select.eval(Select.java:155)
    \tat com.appiancorp.core.expr.tree.Select.eval(Select.java:136)
    \tat com.appiancorp.core.expr.Tree.eval0(Tree.java:214)
    \tat com.appiancorp.core.expr.Tree.eval(Tree.java:210)
    \tat com.appiancorp.core.expr.tree.If.evalInner(If.java:134)
    \tat com.appiancorp.core.expr.tree.If.eval0(If.java:59)
    \tat com.appiancorp.core.expr.tree.TreeEvaluable.eval(TreeEvaluable.java:63)
    \tat com.appiancorp.core.expr.tree.SpecialFunction.eval0(SpecialFunction.java:65)
    \tat com.appiancorp.core.expr.Tree.eval(Tree.java:210)
    \tat com.appiancorp.core.expr.rule.Rule.evalBody(Rule.java:831)
    \tat com.appiancorp.core.expr.rule.Rule.eval(Rule.java:411)
    \tat com.appiancorp.core.expr.rule.Rule.eval(Rule.java:320)
    \tat com.appiancorp.core.expr.rule.Rule.evalWithMetrics(Rule.java:308)
    \tat com.appiancorp.core.expr.rule.Rule.eval(Rule.java:297)
    \tat com.appiancorp.core.expr.tree.FreeformRule.eval(FreeformRule.java:72)
    \tat com.appiancorp.core.expr.tree.FreeformRule.eval0(FreeformRule.java:49)
    \tat com.appiancorp.core.expr.Tree.eval(Tree.java:210)
    \tat com.appiancorp.core.expr.Parse.evalInner(Parse.java:293)
    \tat com.appiancorp.core.expr.Parse.eval(Parse.java:251)
    \tat com.appiancorp.core.expr.Parse.eval(Parse.java:236)
    \tat com.appiancorp.core.expr.AppianScriptEngine.eval(AppianScriptEngine.java:66)
    \tat com.appiancorp.process.engine.ExpressionGroup.eval(ExpressionGroup.java:247)
    \tat com.appiancorp.process.engine.ExpressionGroup.eval(ExpressionGroup.java:296)
    \tat com.appiancorp.process.engine.ExpressionGroupRequest.execute0(ExpressionGroupRequest.java:67)
    \tat com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:80)
    \tat com.appiancorp.mdb.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:26)
    \tat sun.reflect.GeneratedMethodAccessor604.invoke(Unknown Source)
    \tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    \tat java.lang.reflect.Method.invoke(Method.java:497)
    \tat org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
    \tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
    \tat org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
    \tat org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
    \tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
    \tat org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
    \tat org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(
  • 0
    Certified Lead Developer
    @jamesm90 I have seen this issue with query entity rules in the past. One way to get around it is to create a set of query entity rules that each pull back a subset of data and then merge the results in a parent expression rule.
  • @jamesm Could you please attach the definition of the relevant queryEntity() implementation? So far from the logs, it seems to me that there is a problem with the way the queryEntity was invoked. I guess that Appian was unable to parse the queryEntity implementation which might be possible because of the invalid arguments.