# Strange behavior with database connections in Ignition

**URL:** <https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717>\
**Category:** Ignition\
**Tags:** database, ignition81\
**Created:** [June 24, 2025, 2:06pm UTC](https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717 "2025-06-24T14:06:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ha99](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@Ha99](https://forum.inductiveautomation.com/u/Ha99)\
**Post date:** [June 24, 2025, 2:06pm UTC](https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717/1 "2025-06-24T14:06:37Z")

</div>

Hi,

I am experiencing strange behavior with database connections. In one of our environments, the database connections get blocked because the connection limit is reached, but Ignition does not purge the connections (Cannot get a connection, pool error Timeout waiting for idle object).

However, I tested this in my development environment, where I tried to reach the configured connection limit on the gateway for the database connection. In this case, Ignition automatically purged the connections by disabling and re-enabling the database connection, causing the connection count to drop to 0 without any database blocking.

Is there an explanation for this difference?

---

<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:** [June 24, 2025, 2:34pm UTC](https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717/2 "2025-06-24T14:34:45Z")

</div>

> [@Ha99](#):
>
> because the connection limit is reached

The most common cause of this is slow-running queries, often historical queries. Production environments are more likely to have multiple people looking at long trends and stressing your DB.

You should study the gateway's slow query diagnostics, and perhaps have a qualified DBA study your schema. (Particularly looking for missing indices and inefficient query plans.)

---

<div class="post-metadata">

**Author:** ![Ha99](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@Ha99](https://forum.inductiveautomation.com/u/Ha99)\
**Post date:** [June 24, 2025, 2:51pm UTC](https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717/3 "2025-06-24T14:51:09Z")

</div>

Thank you for your response.

I have tested with long-running queries to simulate load on the database, and when I reach the connection limit in one environment, Ignition **automatically purges the connections** (by disabling and re-enabling the database connection), which prevents blocking.

However, in the other environment, Ignition **does not behave the same way** and the connections remain blocked once the limit is reached. I am not sure why this difference occurs.

While I continue to investigate, I am not sure if I should implement a script to increase the number of allowed connections dynamically or to purge (reset) the connections manually via a script in Ignition, is a good idea

---

<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:** [June 24, 2025, 3:05pm UTC](https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717/4 "2025-06-24T15:05:15Z")

</div>

> [@Ha99](#):
>
> Ignition **automatically purges the connections** (by disabling and re-enabling the database connection),

Ignition doesn't do this automatically. Someone might have written a script in that environment to do so. (Which sounds terrible--is this an odd JDBC driver?)

---

<div class="post-metadata">

**Author:** ![Ha99](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@Ha99](https://forum.inductiveautomation.com/u/Ha99)\
**Post date:** [June 25, 2025, 6:37am UTC](https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717/5 "2025-06-25T06:37:41Z")

</div>

No, SQL SERVER driver

---

<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:** [June 25, 2025, 11:33am UTC](https://forum.inductiveautomation.com/t/strange-behavior-with-database-connections-in-ignition/107717/6 "2025-06-25T11:33:07Z")

</div>

I'm out of ideas. You might want to open a support ticket so they can dive deep into your setup.
