Skip to Content
0

Initializing datasource with multiple variables

Feb 17, 2017 at 07:14 PM

62

avatar image
Former Member

I'm currently having performance issues with a (rather large) application in a customer scenario. This application uses quite a few datasources (roughly 20) of which most contain at least 3 variables.

Due to the requirements, merge prompts is set to false. Most of the datasources are loaded in the onStartup event (which I realize probably isn't a best-practice), but this is something that I know how to tweak.

The problem I'm having however, is that the datasources all seem to reload as soon as a variable is set. for example:

DS_1.loadDatasource();

DS_1.setVariableValueExt(dimensionX, value);

DS_1.setVariableValueExt(dimensionY, value);

DS_1.setVariableValueExt(dimensionZ, value);

Is there something obvious I'm overlooking or is there no wat to set the variables and then load the datasource? Putting the DS_1.loadDatasource(); after the other 3 lines doesn't seem to be the answer, but maybe there is another solution?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Mustafa Bensan Feb 18, 2017 at 12:43 PM
0

Hi Roy,

You are not overlooking anything. What you are experiencing is the standard behaviour. If you are loading a data source by script, then the only way to set the variables is after the loadDataSource() method, exactly as you have done in your example. setVariableValueExt() does indeed trigger a reload of the data source. However, in theory at least, if you execute setVariableValueExt() immediately after the loadDataSource() method, in your example the setting of the 3 variable values should occur simultaneously with the data source load triggered by loadDataSource().

In your scenario, are you suggesting that data source DS_1 is being loaded 4 times, once for loadDataSource() and then 3 times again, once for each of the variables?

Regards,

Mustafa.

Share
10 |10000 characters needed characters left characters exceeded