Troubleshooting
Ignition connection pool timeout after redundancy failover
Short answer
The exception means the gateway's JDBC pool hit its Max Active ceiling and a request aged out the full Max Wait without a connection. When failover promotes a WAN-relocated backup to active, every query's round trips cross the WAN, hold times multiply, and demand passes 16 connections even below 40 ms round-trip time. Raise Max Active and Max Idle to 32, set Initial Size and Min Idle to 3 on the master, and move SQL Server next to the active gateway.

On this page
java.sql.SQLException: Cannot get a connection, pool error Timeout waiting for idle object is your gateway's JDBC connection pool giving up, not SQL Server rejecting the login. The reported case ran Ignition 8.1.25 as a redundant pair with SQL Server in the original datacenter, and one gateway had been relocated to a distant site. The relocated backup rejoined redundancy with live database connections and looked healthy; the pool timed out only after failover promoted it to active, with its connection count climbing well above anything the master had shown. Raise Max Active and Max Idle from 16 to 32 connections, set Initial Size and Min Idle to 3, make the edit on the master, and plan the database move. Below is why the WAN does this, the checks that pick your branch, and the procedure.
The error comes from the gateway pool #
A connection pool is a fixed set of open database sessions the gateway lends to each query and reclaims when the query finishes. Max Active caps how many sessions can exist, and Max Wait is the time in milliseconds the pool will wait for a connection to be returned when none is available, as the Ignition user manual defines it. The exception therefore means every allowed connection was checked out and a request aged out the entire wait without getting one: a queueing symptom inside the gateway, not a broken database. A failed login, a TLS negotiation fault or an unreachable server raises different errors and follows a different path, the one traced in SQL Server connection faults after an Ignition upgrade. For reading the pool metrics while the fault is live, database connection pool exhaustion troubleshooting goes deeper.
Why the relocated node exhausts the pool #
Connections in use follow Little's law, L = λ × W: the query arrival rate multiplied by the mean time a query holds a connection. Relocating the gateway leaves the arrival rate untouched and multiplies the hold time, because every network round trip inside a query now crosses the WAN. The inter-site round trip in the reported case measured under 40 ms.
That sounds harmless until you count round trips: execute, result fetches and commit each pay the full round trip, so a query with k round trips gains roughly k × RTT of hold time. Transaction groups, tag history writes, alarm journal inserts and binding polls all queue behind that inflated hold time, and failover then adds a burst on top: store-and-forward catch-up, transaction groups resuming, clients reconnecting and re-running startup queries, all at once. The reported signature, intermittent peaks above the ceiling rather than a flat line, is bursts riding a raised baseline.
Worked example with the arithmetic #
Illustrative inputs, so replace them with your measurements:
- Steady arrival rate on the active gateway: 40 queries per second.
- Mean hold time in the original datacenter: 25 ms, mostly SQL Server execution, with local round trips near 0.5 ms.
- Round trips per query: 3.
- WAN round trip: 38 ms, the class reported above.
Same-datacenter demand: 40 queries/s × 0.025 s = 1.0 connection.
WAN transit added per query: 3 × 38 ms = 114 ms, so the new hold time is 25 ms + 114 ms = 139 ms = 0.139 s.
Steady demand across the WAN: 40 queries/s × 0.139 s = 5.6 connections.
Post-failover burst at three times the arrival rate: 120 queries/s × 0.139 s = 16.7 connections, past a 16-connection ceiling, so requests queue and age out Max Wait, which is the logged error. With the ceiling raised as below, that burst fits with room for a heavier flush. Your decision comes from your own arrival rate and hold time: the ceiling must sit above the post-failover burst peak with margin, and the reported case cleared at the values in the table.
Checks that pick your branch #
Run these in order, on the node that is actually active:
- Round-trip time, active gateway host to SQL Server host. Not gateway-to-gateway: that ping describes redundancy sync, not database transit. Sub-millisecond class means relocation did not change hold time, so go to check 3. Tens of milliseconds makes latency-inflated hold time the prime suspect; continue to check 2.
- Active connection count against the ceiling while the error logs, read from the database connection status in the Gateway webpage. Pinned at Max Active means the pool is exhausted: apply the settings below. Well below the ceiling while connections still fail means the pool is not the limit: trace firewall session limits, idle-session drops on the WAN link and TLS or login failures, the path covered in reconnecting an edge PC to SQL Server after connection loss.
- Query duration, gateway side against SQL Server side, for the same statements. Slower only from the gateway: the difference is network transit, which confirms the latency branch. Slow on the server too: look for blocking, lock waits and missing indexes in SQL Server's Activity Monitor, because a larger pool only queues more blocked sessions.
- Burst sources immediately after takeover. Store-and-forward flush, resuming transaction groups and client startup queries land together, so a pool sized with no margin fails precisely at failover. Peaks confined to the first minutes are the burst signature.
| Reading | Meaning | Action |
|---|---|---|
| Count pinned at the ceiling, WAN-class round trip to the database | Latency-inflated hold time | Enlarge the pool now; schedule the database beside the active gateway |
| Count pinned, queries also slow on the SQL Server side | Blocking or poor query plans | Fix queries and indexes first |
| Count well below the ceiling, connections still failing | Network or authentication fault | Work the firewall and session path; pool size changes nothing |
| Peaks only in the first minutes after failover | Store-and-forward and startup burst | Put the ceiling above the measured burst peak |
The settings that cleared the fault #
| Setting | Original | Changed to | Role in the fix |
|---|---|---|---|
| Max Active | 16 | 32 | Ceiling above the measured burst peak |
| Max Idle | 16 | 32 | Holds burst connections open instead of retiring them |
| Initial Size | 0 | 3 | Warm sessions from gateway startup |
| Min Idle | 0 | 3 | Floor of warm sessions, so post-failover queries skip setup round trips |
| Max Wait | 5000 ms | 10000 ms | Margin only, not the fix |
The two ceiling values are the resolving change. The warm-session pair removes connection-setup round trips from the worst moment, and the longer wait only buys margin. Use these values for this symptom class, then re-derive them from your own measurements once the database is local again.
Apply the change on the master node #
- Open the database connection's settings in the Gateway webpage on the master. A redundant pair synchronizes gateway configuration from master to backup, so an edit made only on the backup is overwritten at the next sync.
- Set the five values as in the table.
- Confirm the instance accepts the combined ceilings from both gateways plus every other application sharing it.
- Schedule the SQL Server migration into the same datacenter as the active gateway. The enlarged pool is a bridge across the WAN period, not the final state.
- After the database moves, re-baseline peak connection usage and size Max Active from the measured peak plus margin, not from the WAN-era number.
Verify under a real failover #
- Confirm both nodes show the synchronized values from the table, the backup included.
- Switch the active node with the redundancy system's Request Failover option under production-level load, then watch the connection status through the first minutes: the connection stays valid and the active count peaks below the new ceiling.
- Scan the gateway logs across a full production cycle and expect zero recurrences of the timeout error.
Pitfalls that waste an afternoon #
- Trusting a green backup. An idle backup carries almost no query load and reconnects cleanly, so it looks healthy right up until failover puts the whole workload on it.
- Measuring gateway-to-gateway latency. That path carries redundancy sync; the path that matters runs from the active gateway to SQL Server.
- Restarting the gateway service. A restart empties the pool and the same load refills it; in the reported case the restart reproduced the identical error.
- Setting Max Active very high. The queue moves onto SQL Server workers and memory and every query slows, so size from measured peaks instead.
Questions asked
Why must Max Idle equal Max Active?
When Max Idle is lower, the pool retires the extra connections as soon as a burst returns them, and the next burst pays TCP and login round trips across the WAN to rebuild them, stretching hold time exactly when demand peaks. Keeping the two values equal lets burst connections idle warm between peaks instead of dying and being rebuilt.
What does each pooled connection cost on the SQL Server side?
Every pooled connection is a SQL Server session holding a worker and session memory. Two gateways at the raised ceiling can open 64 sessions to that database at full load, so confirm the instance's own maximum connection count and memory headroom also cover every other application sharing the instance before you commit the change.
Do the same values belong on the failover datasource?
A database connection can carry a failover datasource that queries pass through to when the main connection is unavailable. That target is its own connection with its own pool, so give it the same ceiling and warm-session floor if failover would push your WAN-era load onto it.
Does raising Max Wait alone fix it?
No. A longer Max Wait turns immediate errors into slow screens and delayed history writes while tag history and transaction groups back up into store-and-forward, and that backlog later flushes as a larger burst. Raise it only for margin alongside a larger Max Active. Here Max Wait went from 5000 to 10000 milliseconds, and the ceiling was the resolving change.

