Skip to content

Commit

Permalink
Oracle dependencies update (JDBC Driver, XMLParser, DMS) to 21c (ecli…
Browse files Browse the repository at this point in the history
…pse-ee4j#1376)

Oracle dependencies update (JDBC Driver, XMLParser, DMS)

Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman authored Jan 7, 2022
1 parent 0ba1eef commit 1158e02
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 95 deletions.
12 changes: 6 additions & 6 deletions bundles/eclipselink/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -160,31 +160,31 @@
</dependency>

<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xmlparserv2</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ucp</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xdb</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.observability</groupId>
<artifactId>dms</artifactId>
<scope>provided</scope>
<optional>true</optional>
Expand Down
4 changes: 2 additions & 2 deletions dbws/eclipselink.dbws.test.oracle/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -75,7 +75,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>test</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions foundation/eclipselink.extension.oracle.spatial.test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -55,7 +55,7 @@
<!--Oracle proprietary dependencies-->
<!--JDBC driver dependencies-->
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>test</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions foundation/org.eclipse.persistence.oracle.nosql/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -82,7 +82,7 @@
</dependency>
<!--JDBC driver dependencies-->
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>test</scope>
</dependency>
Expand Down
12 changes: 6 additions & 6 deletions foundation/org.eclipse.persistence.oracle.test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -60,27 +60,27 @@
<!--Oracle proprietary dependencies-->
<!--JDBC driver dependencies-->
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xmlparserv2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ucp</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xdb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.observability</groupId>
<artifactId>dms</artifactId>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
}
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -49,7 +49,6 @@ public void setProxyConnectorIntoLogin(DatabaseLogin login, Session session) thr

public void close() throws SQLException {
if (oracleDataSource != null) {
oracleDataSource.close();
oracleDataSource = null;
}
}
Expand Down
12 changes: 6 additions & 6 deletions foundation/org.eclipse.persistence.oracle/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -40,31 +40,31 @@
<!--Oracle proprietary dependencies-->
<!--JDBC driver dependencies-->
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xmlparserv2</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ucp</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xdb</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.observability</groupId>
<artifactId>dms</artifactId>
<scope>provided</scope>
<optional>true</optional>
Expand Down
8 changes: 4 additions & 4 deletions jpa/eclipselink.jpa.oracle.test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -180,17 +180,17 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xmlparserv2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xdb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.nls</groupId>
<artifactId>orai18n</artifactId>
<scope>test</scope>
</dependency>
Expand Down
Loading

0 comments on commit 1158e02

Please sign in to comment.