JDBC:Oracle通用连接池错误UCP-45060生命周期状态无效

时间:2016-09-27 08:57:37

标签: java oracle jdbc connection ucp

我正在使用Oracle UCP(通用连接池)。处理大约100K记录后,我收到以下错误。

    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

以下是创建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");

然后我从数据源获得连接

datasource.getConnection();

1 个答案:

答案 0 :(得分:0)

就我而言,我使用了错误的密码:|