Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Timeout issue while trying to fetch data from Hypercube

Hi,

I have a method to fetch data from objects. I am using kpilayout and hypercube to extract data from multiple pages. With large datasets, this method started failing with the GetLayout() method timing out. Is there any workaround to this?

My requirement is to extract the records from several tables and return IEnumerable<IEnumerable<string>>.

Below is some of the code that I am using:

using (var kpiLayout = appObject.GetLayout().As<KpiLayout>()) - This is the line that times out

{

     //Some logic to find the pagesize used below

     var hyperCubeData = appObject.GetHyperCubeData("/qHyperCubeDef", new[] { new NxPage { Top = page * rowPageSize, Height = rowPageSize, Width = hyperCube.Size.cx, Left = 0 } });

     if (hyperCubeData != null && hyperCubeData.Any())

     {

         foreach (var dataPage in hyperCubeData)

         {

             if (dataPage.Matrix.Any())

             {

                 foreach (var cellRow in dataPage.Matrix)

                 {

                     if (cellRow.Any())

                     {

                         row = new List<string>();

                         foreach (var cell in cellRow)

                         {

                             row.Add(Convert.ToString(cell.Num) == "NaN" ? cell.Text : Convert.ToString(cell.Num));

                         }

                         rows.Add(row);

                     }

                 }

             }

         }

     }

}

Right now, I am stuck here.

Also noticed that if the object is loaded once manually through the UI, the timeout stops. Is there anyway to force the layout load?

Thanks,

Anoop

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can change the default timeout by setting the static property:

Qlik.Sense.JsonRpc.RpcConnection.Timeout = n;

where n is the timeout in milliseconds.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Øystein_Kolsrud
Employee
Employee

Rob pointed to the timeout setting, but another approach might be to use the async version of GetLayout instead. That way you can have full control over the timeout yourself.