Error database connection

sometimes there is connection error to a Sql server database in my Ignition project v 8.1.16.

What could the reason be???

THank you

Please post all the text of the error message and format it with the </> button.

java.sql.SQLException: Cannot get a connection, pool error Timeout waiting for idle object
at org.apache.commons.dbcp2.PoolingDataSource.getConnection(
at org.apache.commons.dbcp2.BasicDataSource.getConnection(
at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(
at com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl.getConnectionImpl(
at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnection(
at com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl.getConnection(
at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities.getConnection(
at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.AbstractDBAction.invoke(
at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(
at org.eclipse.jetty.servlet.ServletHolder.handle(
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(
at org.eclipse.jetty.servlet.ServletHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(
at org.eclipse.jetty.server.session.SessionHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(
at org.eclipse.jetty.servlet.ServletHandler.doScope(
at org.eclipse.jetty.server.session.SessionHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at com.inductiveautomation.catapult.handlers.RemoteHostNameLookupHandler.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
at org.eclipse.jetty.server.handler.HandlerList.handle(
at org.eclipse.jetty.server.handler.HandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(
at org.eclipse.jetty.server.HttpChannel.dispatch(
at org.eclipse.jetty.server.HttpChannel.handle(
at org.eclipse.jetty.server.HttpConnection.onFillable(
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$
at java.base/ Source)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
at org.apache.commons.dbcp2.PoolingDataSource.getConnection(
... 51 common frames omitted
  1. Is the server on the same computer as the Ignition gateway?
  2. If not, is it on the same subnet as the gateway or is it remote?
  3. Is it Microsoft SQL Server?
  4. What other information do you have that might help?

Right at the top:

Cannot get a connection, pool error Timeout waiting for idle object

This isn't an error on the database side, strictly speaking. Ignition makes multiple internal connections to your DB and recycles them as each query completes. The number and behavior of this "connection pool" is part of the advance settings on a database connection.

Not getting a connection for this timeout means you are running more simultaneous long queries than your DB can handle. Either your queries are not properly optimized, or your DB is simply not powerful enough to keep up.

This error doesn't give enough information to tell which of those cases apply.

1 Like

That's interesting, Phil. The "pool" is some maximum number of available connections internal to the database? And each query takes one from the pool until completed or timed out?

Not internal to the database, but internal to Ignition, based on the data source connection settings.

1 Like

Sql Server is on the same computer of Ignition Gatewway

-Have you upgraded the gateway recently?
-did you try to connect directly to the database through ssms "microsoft sql server management studio"?

No, I don't upgraded gateway recently.
When there is error of database connection, it is not possible connect with "microsoft sql server management studio"

If you cannot connect through SSMS ,so it is not the problem of ignition ,If you can connect through SSMS but can not connect through ignition ,here you have a problem in ignition.

Well, this can happen due to connection issues means there are many chances of connection leaks for this you can increase the connection pool size there is a strong chance of fixing these issues.


This I have not ever seen. In every case I've seen (many), the number of queries trying to run times the average execution time was greater than the timeout for acquiring a connection.

Maybe. If the number of queries that are running too long are strictly limited, this can help. But if the DB is overloaded (as I suspect), then more connections won't make the database go faster--the extra connections will simply bog down, too.

This forum has many international participants whose first language is not English. Proper sentence structure, capitalization, and punctuation are not only signs of professionalism, but are crucial for understanding among the non-native-english-speakers here. Please correct your comment accordingly.

This is terribly unwise, especially for a production system.

1 Like