JDBC: Oracle Universal Connection Pool Error UCP-45060 Invalid life cycle state

Amr ElAdawy picture Amr ElAdawy · Sep 27, 2016 · Viewed 7.7k times · Source

I am using Oracle UCP (Universal Connection Pool). I am getting the following error after processing around 100K records.

    oracle.ucp.UniversalConnectionPoolException: Invalid life cycle state. Check the status of the Universal Connection Pool
        at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:488) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
        at oracle.ucp.util.UCPErrorHandler.throwSQLException(UCPErrorHandler.java:163) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
        at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:943) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
        at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:873) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
        at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:863) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
 Caused by: oracle.ucp.UniversalConnectionPoolException: Invalid life cycle state. Check the status of the Universal Connection Pool
            at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:368) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:49) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:80) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:131) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.common.UniversalConnectionPoolImpl.borrowConnectionWithoutCountingRequests(UniversalConnectionPoolImpl.java:304) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.common.UniversalConnectionPoolImpl.borrowConnectionAndValidate(UniversalConnectionPoolImpl.java:168) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.common.UniversalConnectionPoolImpl.borrowConnection(UniversalConnectionPoolImpl.java:143) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.jdbc.JDBCConnectionPool.borrowConnection(JDBCConnectionPool.java:157) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:931) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0]
            ... 15 more

Here is the code snippet to create the DataSource

PoolDataSource dataSource = PoolDataSourceFactory.getPoolDataSource();


    dataSource.setURL("jdbc.url"));
    dataSource.setUser("jdbc.user"));
    dataSource.setPassword("jdbc.password"));
    dataSource.setMaxConnectionReuseCount(100);

    dataSource.setInitialPoolSize(50);
    dataSource.setMinPoolSize(50);

    dataSource.setMaxPoolSize(100);

    dataSource.setValidateConnectionOnBorrow(true);

    dataSource.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");

And then I get the connection from data source as

datasource.getConnection();

Answer

Abdul Mohsin picture Abdul Mohsin · Jun 22, 2020

In my case, I was using wrong password :|