# Ignition Error Running Query

**URL:** <https://forum.inductiveautomation.com/t/ignition-error-running-query/80960>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [October 25, 2023, 2:21pm UTC](https://forum.inductiveautomation.com/t/ignition-error-running-query/80960 "2023-10-25T14:21:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ly17](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Ly17](https://forum.inductiveautomation.com/u/Ly17)\
**Post date:** [October 25, 2023, 2:21pm UTC](https://forum.inductiveautomation.com/t/ignition-error-running-query/80960/1 "2023-10-25T14:21:39Z")

</div>

Hi, I have many inputs using SQL queries running every 15 secs or so in many of my windows in Vision and I often get this error message.

> Exception: Error running query:  
> SQLQuery(query=SELECT [Total\_DT]  
> FROM [LKC\_DT\_Table\_L2]  
> WHERE RowNo = 13, database=)@20000ms  
> On: Line 2 Shift 1.Root Container.ST13.floatValue  
> caused by GatewayException: Connection Error: Cannot get a connection, pool error Timeout waiting for idle object  
> caused by SQLException: Cannot get a connection, pool error Timeout waiting for idle object
> 
> Ignition v8.1.30 (b2023071408)  
> Java: Azul Systems, Inc. 11.0.18

Any thoughts to make on resolving this issue? Thanks.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 25, 2023, 2:30pm UTC](https://forum.inductiveautomation.com/t/ignition-error-running-query/80960/2 "2023-10-25T14:30:59Z")

</div>

This is not an issue with the query but with your gateway getting a connection to your database. It's possible your database is occasionally unreachable which could cause such an error and that could be for a variety of reasons, or your connection pool is full.

You may want to check out your db logs and if there is a dba who is in charge of it - talk to them if there is one.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 25, 2023, 3:16pm UTC](https://forum.inductiveautomation.com/t/ignition-error-running-query/80960/3 "2023-10-25T15:16:49Z")

</div>

> [@Ly17](#):
>
> many inputs using SQL queries running every 15 secs or so in many of my windows in Vision

This sounds pathological. Why is this necessary?

---

<div class="post-metadata">

**Author:** ![Ly17](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Ly17](https://forum.inductiveautomation.com/u/Ly17)\
**Post date:** [October 25, 2023, 6:00pm UTC](https://forum.inductiveautomation.com/t/ignition-error-running-query/80960/4 "2023-10-25T18:00:01Z")

</div>

We have data from a legacy monitoring system that stores to SQL DB. So in the short term, we have created many SQL queries of many of our tags and inputs etc.Could that be the cause?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 25, 2023, 6:03pm UTC](https://forum.inductiveautomation.com/t/ignition-error-running-query/80960/5 "2023-10-25T18:03:36Z")

</div>

Is it really updating every 15 seconds? If so ok, but you have this same logic on each window? Seems better suited as a gateway tags (if the same for the entire system) or vision client tags (if specific to a single user). Otherwise a user has multiple windows open and now you are unnecessarily bogging down the db doing the same thing.

---

<div class="post-metadata">

**Author:** ![Ly17](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Ly17](https://forum.inductiveautomation.com/u/Ly17)\
**Post date:** [October 25, 2023, 6:29pm UTC](https://forum.inductiveautomation.com/t/ignition-error-running-query/80960/6 "2023-10-25T18:29:53Z")

</div>

I have them on other windows but I have other projects inheriting from this one configured so that only the one window is active when others are using Vision client. Looking at the DB status, it's performing about 50-70 queries per secs. Is that too much?
