I have a service deployed on multiple EC2 hosts. 1 host starts throwing errors. The max connections allowed are 5 and at the time of outage I could see the number of active connectives to be 2. IT would have made sense if the outage was across all hosts but I am not able to understand what caused the issue on a single host.
DB was able to provide connections. If this is a host issue, how should I resolve this?
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection | at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) | at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) | at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) | at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) | at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) | at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) | at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160) | at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81) | at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473) | at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:560) | ... 26 more | Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted | at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103) | at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) | at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:85) | at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) | ... 31 more | Caused by: java.util.NoSuchElementException: Timeout waiting for idle object | at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:756) | at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) | ... 34 more },