returning unexpected error while querying DB table

I am using a!queryEntity() to query a DB table where I am only using 2 filters to fetch the results. I am also using pagination for it. Also, this issue is not occurring for all the records. It just occurs intermittently and it also resolves the moment we try to re query using same data. does anyone knows what could be the reason for it?

This is the complete error: An error occurred while evaluating expression: XXXXX (Expression evaluation error in rule XXXX at function a!queryEntity [line 4]: An error occurred while retrieving the data. Details: Unexpected error executing query

I doubt if the batch i set might be causing it? I have set the batch size to -1? Does it have any impact in query performance?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    Thanks for the response. I have updated the batch size. Also, I would like to update the process model a bit by checking if the script task node that uses a!queryEntity() logic is unattended, then i am aiming to set a second flow with timer which should still continue even if the existing flow errors. If the existing flow errors for some other reason, then the timer flow checks if the first flow managed to get past the DB query node and try again. But I am unable to update the configuration of existing script task node to execute the alternative timer flow if its unattended. Can i get some suggestions around this as well please?

  • 0
    Certified Lead Developer
    in reply to poojithak
    But I am unable to update the configuration of existing script task node to execute the alternative timer flow if its unattended.

    Please explain in more detail what you mean by that.

    The pattern you describe is dangerous as it looks like a save way to handle this scenario, but in the end will result in increased support effort when your queries become slower with a growing data volume.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Sorry for the confusion. Let me make it clear. I have a process model with start node followed by Script node. The script node has the logic of querying the DB via a!queryEntity() using an expression rule. Currently, if the query errors then the script node is errored and the process does not move forward. The workaround we are doing is to restart the script node. Now that I have updated the batch size, we might catch the query error but I also want to address the issue 100%. I want to create an alternate flow using a timer option that executes even if the script node is errored for some reason. Basically all i want to achieve in alternate flow is to check if the query is executed successfully? If yes, the flow proceeds further, otherwise it will again use the same query logic to fetch the results. This is just to handle manual workarounds.

Reply
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Sorry for the confusion. Let me make it clear. I have a process model with start node followed by Script node. The script node has the logic of querying the DB via a!queryEntity() using an expression rule. Currently, if the query errors then the script node is errored and the process does not move forward. The workaround we are doing is to restart the script node. Now that I have updated the batch size, we might catch the query error but I also want to address the issue 100%. I want to create an alternate flow using a timer option that executes even if the script node is errored for some reason. Basically all i want to achieve in alternate flow is to check if the query is executed successfully? If yes, the flow proceeds further, otherwise it will again use the same query logic to fetch the results. This is just to handle manual workarounds.

Children