Expand my Community achievements bar.

SOLVED

Javascript query limitation

Avatar

Level 2

Hello,

I'm triying to retrieve, in a workflow of ACv6, the output population of a delivery, by a javascript activity but it doesn't work always. The aim of this is to retrieve the recipientID and the broadLogId.

When the population is less than 10.000 recipients, it works correctly but when it is bigger than this size the script retrieve only the first 10.000 registries in the resulset. ¿Is there any limitation for the queries in javascript?

Here is my code:

   Captura2.JPG

Anyone could help me?

Regards,

Andrés.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Buenas tardes Andrés,

Regarding Javascript limitations, if you are hosted on Premise, you can raise the memory allocated in the serverConf.xml file:

<!-- Configuring the JavaScript interpreter

     maxMB :  Maximum size in megabytes before running the garbage collector Default: 64

     stackSizeKB :  Size of each stack chunk in kilo octets Default: 8 -->

<javaScript maxMB="512" stackSizeKB="8"/>

Please read the only documentation (as far as I know) to this configuration change below:

Actions on reports

section Memory allocation.

However, in my opinion, you should manage differently your requirement.
Because, if your result set is not 50.000 but 10 millions of line, you can't increase the server memory allocated to huge value, otherwise it would compromise other processes.
And Javascript array is not done for huge volume.

Moreover, the time to execute your Javascript code would take too long, with an expected time-out sometimes...

So I recommend you to find out another method, for instance, putting your data in a custom work table, etc.

Regards
Jean-Serge

View solution in original post

6 Replies

Avatar

Level 3

I believe that queryDef is limited to 10,000 rows of results.

Someone in a similar thread mentioned that you can:

1. Break your query in multiple parts by providing some range or filters

2. write one custom sql script for your query and execute that from your js activity.

Avatar

Employee

Hello Andres,

Please use something like linecount=<no of records to retrieve> or noLineCount =true when creating the query def.

It would look like <queryDef schema=schemaName operation= Select lineCount= 100000 or noLineCount=true

Regards,

Adhiyan

Avatar

Level 2

Hello,

It has resolved the problem. Now, the query retrives the expected records.

Thank you very much for your help. It was very helpful.

Andrés.

Avatar

Level 2

Hello again,

I thinked that the problem was resolved when I checked it with an expected result of 30.000 registries and it worked, but now, I have tried with more than 50.000 registries and, in this case, the result of the query is an empty resultset.

The queryDef  is as you can see bellow:

1466669_pastedImage_18.png

Anyone knows what is the problem? Maybe a memory limitations?

Thank you in advance.

Regards,

Andrés.

Avatar

Correct answer by
Level 10

Buenas tardes Andrés,

Regarding Javascript limitations, if you are hosted on Premise, you can raise the memory allocated in the serverConf.xml file:

<!-- Configuring the JavaScript interpreter

     maxMB :  Maximum size in megabytes before running the garbage collector Default: 64

     stackSizeKB :  Size of each stack chunk in kilo octets Default: 8 -->

<javaScript maxMB="512" stackSizeKB="8"/>

Please read the only documentation (as far as I know) to this configuration change below:

Actions on reports

section Memory allocation.

However, in my opinion, you should manage differently your requirement.
Because, if your result set is not 50.000 but 10 millions of line, you can't increase the server memory allocated to huge value, otherwise it would compromise other processes.
And Javascript array is not done for huge volume.

Moreover, the time to execute your Javascript code would take too long, with an expected time-out sometimes...

So I recommend you to find out another method, for instance, putting your data in a custom work table, etc.

Regards
Jean-Serge

Avatar

Level 2

Hello Jean-Serge,

Thank you very much for your quickly response. It was very useful.

As you recommend, I'll try to find another way to do my requirements.

Regards,

Andrés.