# Queries don't return data 100% of the time

**URL:** <https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037>\
**Category:** Ignition\
**Created:** [July 14, 2010, 4:24pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037 "2010-07-14T16:24:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon.Trusik](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jon.Trusik](https://forum.inductiveautomation.com/u/Jon.Trusik)\
**Post date:** [July 14, 2010, 4:24pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/1 "2010-07-14T16:24:56Z")

</div>

I have a window that has 2 tables and a Pie Chart, the 3 have SQL Query bindings. The data is on an MSSQL server located elsewhere on the network. The polling mode on all 3 is ‘off’. Problem is, when opening the window, all 3 do not return the requested data 100% of the time. I put a refresh button on the screen and pressing it a couple times generally does the trick. I assume it is a timing issue.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [July 15, 2010, 8:17am UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/2 "2010-07-15T08:17:36Z")

</div>

Those queries should run. To check you can save the window with the properties cleared out (datasets with no data, empty strings or -1 numeric values) to see if data comes through when the window is opened.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [July 15, 2010, 11:54pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/3 "2010-07-15T23:54:10Z")

</div>

Yeah they should certainly run. There might be something subtle going on with various interconnected bindings? We might need to see the window to give you a definitive answer.

---

<div class="post-metadata">

**Author:** ![Jon.Trusik](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jon.Trusik](https://forum.inductiveautomation.com/u/Jon.Trusik)\
**Post date:** [August 25, 2010, 6:28pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/4 "2010-08-25T18:28:46Z")

</div>

As an update to this problem, it is still occurring. But it is server/gateway dependent. I have one window in particular that has 2 tables and 1 chart, hence when it opens, the 3 queries fire essentially together. At one of our plants with newer server hardware and less traffic, the data is returned everytime. At one of our older locations with older hardware and more users, I consistantly have a problem. It is random on which query or how many of the 3 fail. They typically return only the first row of the data. I created a refresh button for each and after refreshing multiple times, the data appears. Any suggestions on what I can do to get these to hit everytime? In VB, I could loop till the data was returned. I also have a new screen that has a more complicated query and it takes several refreshes to return correctly. Just as a point of referenct, in all cases, when I run these queries in MS SQL Query Analyzer, they work everytime.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [August 25, 2010, 7:35pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/5 "2010-08-25T19:35:31Z")

</div>

So it sounds like they’re running, but timing out? Perhaps your database connection pool is becoming intermittently full - check it out in the Gateway’s Status page. Maybe increasing the max size of the pool would help.

---

<div class="post-metadata">

**Author:** ![Jon.Trusik](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jon.Trusik](https://forum.inductiveautomation.com/u/Jon.Trusik)\
**Post date:** [August 25, 2010, 8:19pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/6 "2010-08-25T20:19:11Z")

</div>

Thanks, I’ve increased to 12 from 8 to see what happens overnight.

---

<div class="post-metadata">

**Author:** ![Jon.Trusik](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jon.Trusik](https://forum.inductiveautomation.com/u/Jon.Trusik)\
**Post date:** [August 26, 2010, 12:28pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/7 "2010-08-26T12:28:58Z")

</div>

There was no noticeable improvement after increasing the pool size. Will be adding more ram after returning from the states to see if that helps.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [August 26, 2010, 4:38pm UTC](https://forum.inductiveautomation.com/t/queries-dont-return-data-100-of-the-time/2037/8 "2010-08-26T16:38:04Z")

</div>

Are you getting errors in the client? Check the error log in the client under the Help \> Diagnostics panel.

If a query times out you should get an error about it.
