Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrades Oracle database libraries to version 21.9.0.0. Adds tests under datasource-ucp CDI integration. #8221

Merged
merged 5 commits into from
Feb 15, 2024

Conversation

ljnelson
Copy link
Member

@ljnelson ljnelson commented Jan 11, 2024

This PR updates the Oracle database library versions to 21.9.0.0.

Versions of the Universal Connection Pool higher than this can throw NullPointerExceptions if a non-Oracle driver is used (such as H2's). One of the tests this PR adds checks for this problem explicitly to catch it early should an accidental upgrade beyond 21.9.0.0 occur in the future.

This PR also ensures that we are using the ojdbc11 family of artifacts, at least in the datasource-ucp CDI integration, which are the ones that should be used with JDK 11+ (or 21, which is the base of Helidon 4). See https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html for more information.

It also adds a test resulting from a very lengthy internal discussion that shows that the Universal Connection Pool does not do anything to reset any underlying connection state when a borrowed connection is checked out, modified, and returned to the pool. This is useful information going forward and we want this test to fail/alert us if UCP addresses this shortcoming in any way.

@ljnelson ljnelson added P3 dependencies Pull requests that update a dependency file integration java Pull requests that update Java code 4.x Version 4.x junit labels Jan 11, 2024
@ljnelson ljnelson self-assigned this Jan 11, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 11, 2024
tjquinno
tjquinno previously approved these changes Jan 11, 2024
Copy link
Member

@barchetta barchetta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other areas that ojdbc8-production is used?

./integrations/db/ojdbc/pom.xml:            <artifactId>ojdbc8-production</artifactId>
./examples/employee-app/pom.xml:            <artifactId>ojdbc8-production</artifactId>
./examples/integrations/oci/atp/pom.xml:            <artifactId>ojdbc8-production</artifactId>
./examples/integrations/oci/atp-cdi/pom.xml:            <artifactId>ojdbc8-production</artifactId>
./examples/integrations/cdi/datasource-hikaricp/pom.xml:            <artifactId>ojdbc8-production</artifactId>
./messaging/connectors/aq/pom.xml:            <artifactId>ojdbc8-production</artifactId>

@ljnelson
Copy link
Member Author

What about the other areas that ojdbc8-production is used?

Sure, I'll take care of those.

…er datasource-ucp CDI integration.

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
…base

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
@ljnelson ljnelson force-pushed the autocommit-explorations-0 branch from 5ec685b to ed0fba3 Compare February 14, 2024 17:00
@@ -127,7 +127,8 @@
<version.lib.neo4j>5.12.0</version.lib.neo4j>
<version.lib.netty>4.1.100.Final</version.lib.netty>
<version.lib.oci>3.34.0</version.lib.oci>
<version.lib.ojdbc8>21.4.0.0</version.lib.ojdbc8>
<version.lib.ojdbc>21.9.0.0</version.lib.ojdbc>
<version.lib.ojdbc8>${version.lib.ojdbc}</version.lib.ojdbc8>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we keeping this property for backward compatibility or should we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption has always been that if there is a property defined in a pom.xml somewhere that appears in the inheritance chain of, say, applications/mp/pom.xml, which this one does, then it probably should obey the rules of semantic versioning, so should stick around, in this case, until Helidon 5. Maybe others have opinions.

@ljnelson
Copy link
Member Author

Hmm; might also need to decipher https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html

arjav-desai
arjav-desai previously approved these changes Feb 14, 2024
Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
@ljnelson ljnelson changed the title Upgrades Oracle database libraries to version 21.9.0.0. Adds test under datasource-ucp CDI integration. Upgrades Oracle database libraries to version 21.11.0.0. Adds test under datasource-ucp CDI integration. Feb 14, 2024
arjav-desai
arjav-desai previously approved these changes Feb 14, 2024
@ljnelson
Copy link
Member Author

Hmm; UCP is dying:

21:50:05,662 [INFO] Caused by: oracle.ucp.UniversalConnectionPoolException: Universal Connection Pool internal error: java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null
21:50:05,662 [INFO] 	at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:379)
21:50:05,662 [INFO] 	at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:69)
21:50:05,662 [INFO] 	at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:92)
21:50:05,662 [INFO] 	at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:165)
21:50:05,662 [INFO] 	at oracle.ucp.common.Core.growBorrowed(Core.java:1316)
21:50:05,662 [INFO] 	at oracle.ucp.common.UniversalConnectionPoolImpl.helpGrowBorrowed(UniversalConnectionPoolImpl.java:407)
21:50:05,662 [INFO] 	at oracle.ucp.common.UniversalConnectionPoolImpl.borrowConnectionWithoutCountingRequests(UniversalConnectionPoolImpl.java:350)
21:50:05,662 [INFO] 	at oracle.ucp.common.UniversalConnectionPoolImpl.borrowConnectionAndValidateHelper(UniversalConnectionPoolImpl.java:206)
21:50:05,662 [INFO] 	at oracle.ucp.common.UniversalConnectionPoolImpl.borrowConnectionAndValidate(UniversalConnectionPoolImpl.java:166)
21:50:05,662 [INFO] 	at oracle.ucp.common.UniversalConnectionPoolImpl.borrowConnection(UniversalConnectionPoolImpl.java:139)
21:50:05,662 [INFO] 	at oracle.ucp.jdbc.JDBCConnectionPool.borrowConnection(JDBCConnectionPool.java:185)
21:50:05,662 [INFO] 	at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:1882)

…s the highest version that can be used that does not throw NullPointerExceptions in certain cases; adds test to catch this problem

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
@ljnelson ljnelson changed the title Upgrades Oracle database libraries to version 21.11.0.0. Adds test under datasource-ucp CDI integration. Upgrades Oracle database libraries to version 21.9.0.0. Adds tests under datasource-ucp CDI integration. Feb 15, 2024
@ljnelson
Copy link
Member Author

The NullPointerException bug in UCP appears in version 21.10.0.0 and 21.11.0.0. I am therefore editing this PR to upgrade to 21.9.0.0 which is the highest version that does not exhibit this behavior.

A workaround, should it become necessary, is to invoke the private PoolDataSource#setServiceName(String) method via reflection and supply it a dummy non-null service name. (This is already handled in the UCPBackedDataSourceExtension if the user has specified a serviceName configuration property.)

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
@ljnelson ljnelson merged commit 164a80b into helidon-io:main Feb 15, 2024
12 checks passed
hrstoyanov pushed a commit to hrstoyanov/helidon that referenced this pull request Feb 23, 2024
…der datasource-ucp CDI integration. (helidon-io#8221)

Upgrades Oracle database libraries to version 21.9.0.0. Adds test under datasource-ucp CDI integration.

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x dependencies Pull requests that update a dependency file integration java Pull requests that update Java code junit OCA Verified All contributors have signed the Oracle Contributor Agreement. P3
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants