我正在尝试使用以下代码创建 UniversalConnectonPool:
// Read and process properties
PoolDataSource poolDataSource = createUniversalConnectionPool();
universalConnectionPoolManager = UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager();
universalConnectionPoolManager.createConnectionPool((UniversalConnectionPoolAdapter) poolDataSource);
universalConnectionPoolManager.startConnectionPool(getSchema());
.
.
.
.
UniversalConnectionPool universalConnectionPool = universalConnectionPoolManager.getConnectionPool(getSchema());
UniversalPooledConnection universalPooledConnection = universalConnectionPool.borrowConnection(universalConnectionPool.getConnectionRetrievalInfo());
connection = (Connection) universalPooledConnection.getPhysicalConnection();
但是第三行universalConnectionPoolManager.createConnectionPool((UniversalConnectionPoolAdapter) poolDataSource);
抛出异常:
Caused by: oracle.ucp.UniversalConnectionPoolException: Universal Connection Pool already exists in the Universal Connection Pool Manager. Universal Connection Pool cannot be added to the Universal Connection Pool Manager
at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:421)
at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:389)
at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:403)
at oracle.ucp.admin.UniversalConnectionPoolManagerBase.setConnectionPool(UniversalConnectionPoolManagerBase.java:599)
at oracle.ucp.admin.UniversalConnectionPoolManagerBase.createConnectionPool(UniversalConnectionPoolManagerBase.java:559)
... 30 more
你能告诉我我在这里做错了什么吗?我是使用连接池的新手,所以仍在学习它的来龙去脉。