diff --git a/bundles/eclipselink/pom.xml b/bundles/eclipselink/pom.xml index 92e003d476b..99431bef8fb 100644 --- a/bundles/eclipselink/pom.xml +++ b/bundles/eclipselink/pom.xml @@ -1,7 +1,7 @@ - com.oracle.ojdbc + com.oracle.database.jdbc ojdbc8 test diff --git a/foundation/org.eclipse.persistence.oracle.nosql/pom.xml b/foundation/org.eclipse.persistence.oracle.nosql/pom.xml index 2e832d53110..b7296f2d156 100644 --- a/foundation/org.eclipse.persistence.oracle.nosql/pom.xml +++ b/foundation/org.eclipse.persistence.oracle.nosql/pom.xml @@ -1,7 +1,7 @@ - com.oracle.ojdbc + com.oracle.database.jdbc ojdbc8 test diff --git a/foundation/org.eclipse.persistence.oracle.test/pom.xml b/foundation/org.eclipse.persistence.oracle.test/pom.xml index e7f0d6f162b..fe5e875db36 100644 --- a/foundation/org.eclipse.persistence.oracle.test/pom.xml +++ b/foundation/org.eclipse.persistence.oracle.test/pom.xml @@ -1,7 +1,7 @@ - com.oracle.ojdbc + com.oracle.database.jdbc ojdbc8 test - com.oracle.ojdbc + com.oracle.database.xml xmlparserv2 test - com.oracle.ojdbc + com.oracle.database.jdbc ucp test - com.oracle.ojdbc + com.oracle.database.xml xdb test - com.oracle.ojdbc + com.oracle.database.observability dms test diff --git a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/framework/oracle/SessionExchanger.java b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/framework/oracle/SessionExchanger.java index 0480865537a..513c4f3a21c 100644 --- a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/framework/oracle/SessionExchanger.java +++ b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/framework/oracle/SessionExchanger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -19,7 +19,8 @@ import java.util.Map; import java.util.Properties; -import oracle.jdbc.pool.OracleDataSource; +import oracle.ucp.jdbc.PoolDataSource; +import oracle.ucp.jdbc.PoolDataSourceFactory; import org.eclipse.persistence.sessions.JNDIConnector; import org.eclipse.persistence.sessions.DatabaseLogin; @@ -52,7 +53,7 @@ public class SessionExchanger { DatabaseSession originalSession; DatabaseSession newSession; boolean hasLoggedOutOriginalSession; - OracleDataSource dataSource; + PoolDataSource dataSource; // pass the original session and params for the new one: // useDatabaseSession - "true" means new session is DatabaseSession; "false" - ServerSession; @@ -157,13 +158,7 @@ void clearNewSession() { } finally { newSession = null; if(dataSource != null) { - try { - dataSource.close(); - } catch (SQLException ex) { - throw new TestProblemException("Exception thrown while closing OracleDataSource:\n", ex); - } finally { - dataSource = null; - } + dataSource = null; } } } @@ -190,21 +185,19 @@ void setProperties(Properties loginProperties, Map sessionProperties) { // create a data source using the supplied connection string void createDataSource(String connectionString, int minConnections, int maxConnections) { try { - dataSource = new OracleDataSource(); + dataSource = PoolDataSourceFactory.getPoolDataSource(); + dataSource.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource"); Properties props = new Properties(); if(minConnections >= 0) { - props.setProperty("MinLimit", Integer.toString(minConnections)); - props.setProperty("InitialLimit", Integer.toString(minConnections)); + dataSource.setMinPoolSize(minConnections); + dataSource.setInitialPoolSize(minConnections); } if(maxConnections >= 0) { - props.setProperty("MaxLimit", Integer.toString(maxConnections)); - } - if(!props.isEmpty()) { - dataSource.setConnectionCacheProperties(props); + dataSource.setMaxPoolSize(maxConnections); } + dataSource.setURL(connectionString); } catch (SQLException ex) { throw new TestProblemException("Failed to create OracleDataSource with " + connectionString + ".\n", ex); } - dataSource.setURL(connectionString); } } diff --git a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/jms/JMSSetupHelper.java b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/jms/JMSSetupHelper.java index 57f499b3c7b..5f963a79d2a 100644 --- a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/jms/JMSSetupHelper.java +++ b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/jms/JMSSetupHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -105,13 +105,6 @@ protected void updateDbSettings() { @Override protected Object[] internalCreateFactory() throws Exception { updateDbSettings(); - if (oracleDataSource != null) { - try { - oracleDataSource.close(); - } catch (java.sql.SQLException ex) { - // ignore - } - } createInDb(); oracleDataSource = new oracle.jdbc.pool.OracleDataSource(); @@ -146,12 +139,7 @@ protected void internalDestroyFactory() throws Exception { destroyInDb(); } catch (java.sql.SQLException ex) { } finally { - try { - oracleDataSource.close(); - } catch (java.sql.SQLException ex) { - } finally { - oracleDataSource = null; - } + oracleDataSource = null; } } diff --git a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/proxyauthentication/ProxyAuthenticationTestSuite.java b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/proxyauthentication/ProxyAuthenticationTestSuite.java index 60b81b3761d..f769a747593 100644 --- a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/proxyauthentication/ProxyAuthenticationTestSuite.java +++ b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/proxyauthentication/ProxyAuthenticationTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,8 +27,9 @@ import junit.framework.TestSuite; import oracle.jdbc.OracleConnection; -import oracle.jdbc.pool.OracleDataSource; +import oracle.ucp.jdbc.PoolDataSource; +import oracle.ucp.jdbc.PoolDataSourceFactory; import org.eclipse.persistence.config.PersistenceUnitProperties; import org.eclipse.persistence.config.ExclusiveConnectionMode; import org.eclipse.persistence.internal.sessions.ExclusiveIsolatedClientSession; @@ -61,7 +62,7 @@ public class ProxyAuthenticationTestSuite extends JUnitTestCase { // indicates whether EclusiveIsolatedClientSession should be used. boolean shoulUseExclusiveIsolatedSession; // datasource created in external connection pooling case. - OracleDataSource dataSource; + PoolDataSource dataSource; // writeUser is set by an event risen by ModifyQuery. private static String writeUser; @@ -171,27 +172,17 @@ public void tearDown() { // the test has customized the factory - it should be closed. closeEntityManagerFactory(); // close the data source if it has been created - if(dataSource != null) { - try { - dataSource.close(); - } catch (SQLException ex) { - throw new RuntimeException("Exception thrown while closing OracleDataSource:\n", ex); - } finally { - dataSource = null; - } - } + dataSource = null; } // create a data source using the supplied connection string void createDataSource(String connectionString) { try { - dataSource = new OracleDataSource(); - Properties props = new Properties(); - // the pool using just one connection would cause deadlock in case of a connection leak - good for the test. - props.setProperty("MinLimit", "1"); - props.setProperty("MaxLimit", "1"); - props.setProperty("InitialLimit", "1"); - dataSource.setConnectionCacheProperties(props); + dataSource = PoolDataSourceFactory.getPoolDataSource(); + dataSource.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource"); + dataSource.setMinPoolSize(1); + dataSource.setMaxPoolSize(1); + dataSource.setInitialPoolSize(1); dataSource.setURL(connectionString); } catch (SQLException ex) { throw new RuntimeException("Failed to create OracleDataSource with " + connectionString + ".\n", ex); diff --git a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/proxyauthentication/oci/ProxyTestHelper.java b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/proxyauthentication/oci/ProxyTestHelper.java index 076626f18ff..2a03adfe2ad 100644 --- a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/proxyauthentication/oci/ProxyTestHelper.java +++ b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/proxyauthentication/oci/ProxyTestHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -49,7 +49,6 @@ public void setProxyConnectorIntoLogin(DatabaseLogin login, Session session) thr public void close() throws SQLException { if (oracleDataSource != null) { - oracleDataSource.close(); oracleDataSource = null; } } diff --git a/foundation/org.eclipse.persistence.oracle/pom.xml b/foundation/org.eclipse.persistence.oracle/pom.xml index a6a61986b54..eeac42ad918 100644 --- a/foundation/org.eclipse.persistence.oracle/pom.xml +++ b/foundation/org.eclipse.persistence.oracle/pom.xml @@ -1,7 +1,7 @@ - com.oracle.ojdbc + com.oracle.database.jdbc ojdbc8 provided true - com.oracle.ojdbc + com.oracle.database.xml xmlparserv2 provided true - com.oracle.ojdbc + com.oracle.database.jdbc ucp provided true - com.oracle.ojdbc + com.oracle.database.xml xdb provided true - com.oracle.ojdbc + com.oracle.database.observability dms provided true diff --git a/jpa/eclipselink.jpa.oracle.test/pom.xml b/jpa/eclipselink.jpa.oracle.test/pom.xml index 6173a9bb8df..4d64202989b 100644 --- a/jpa/eclipselink.jpa.oracle.test/pom.xml +++ b/jpa/eclipselink.jpa.oracle.test/pom.xml @@ -1,7 +1,7 @@ 1.3.0-alpha5 - 19.3.0.0 + 21.3.0.0 19.3.0.0 12.2.1-2-0 @@ -804,37 +804,37 @@ - com.oracle.ojdbc + com.oracle.database.jdbc ojdbc8 ${oracle.jdbc.version} - com.oracle.ojdbc + com.oracle.database.xml xmlparserv2 ${oracle.jdbc.version} - com.oracle.ojdbc + com.oracle.database.jdbc ucp ${oracle.jdbc.version} - com.oracle.ojdbc + com.oracle.database.xml xdb ${oracle.jdbc.version} - com.oracle.ojdbc + com.oracle.database.observability dms ${oracle.jdbc.version} - com.oracle.ojdbc + com.oracle.database.ha simplefan ${oracle.jdbc.version} - com.oracle.ojdbc + com.oracle.database.ha ons ${oracle.jdbc.version} @@ -846,7 +846,7 @@ --> - com.oracle.ojdbc + com.oracle.database.nls orai18n ${oracle.jdbc.version} @@ -1714,7 +1714,7 @@ ${user.home}/${test.oracle.properties.file} ${test.oracle.properties.file} - com.oracle.ojdbc + com.oracle.database.jdbc ojdbc8 ${oracle.jdbc.version} true diff --git a/utils/eclipselink.dbws.builder.test.oracle/pom.xml b/utils/eclipselink.dbws.builder.test.oracle/pom.xml index 7a5ee1eed13..8115cf19e11 100644 --- a/utils/eclipselink.dbws.builder.test.oracle/pom.xml +++ b/utils/eclipselink.dbws.builder.test.oracle/pom.xml @@ -1,7 +1,7 @@ - com.oracle.ojdbc + com.oracle.database.xml xmlparserv2 test - com.oracle.ojdbc + com.oracle.database.xml xdb test