Repository navigation
[OPENJPA-3028] Oracle unit tests and test profiles - #281
Merged
Merged
Conversation
…ime as such The Oracle driver returns a Timestamp for a DATE column, which also holds java.sql.Date and java.sql.Time fields. Selecting COALESCE or CASE over such a field loaded the value with getObject and converted it to the type of the field, which failed on Oracle with "ClassCastException: Cannot convert object ... of type class java.sql.Timestamp into an instance of class java.sql.Date". COALESCE, CASE and NULLIF expressions of type java.sql.Date or java.sql.Time are now read with ResultSet.getDate and getTime, so the driver does the conversion. Such queries now return a java.sql.Date or java.sql.Time on Oracle, as on the other databases. Expressions of any other type are read with getObject as before, and Filters.convert is unchanged.
…eSharedCollectionTable Oracle has no BIGINT type, so creating the shared collection table failed with ORA-00902. The owner join column now takes the type of the id column it references, as on the other databases.
The type of NULLIF over a date field and a JDBC escape is not known, so the value of the driver is returned as it is. A date field is mapped to an Oracle DATE, for which the Oracle driver returns a Timestamp, so testCaseAndNullIfInMemory failed with "expected:<[2022-06-15 00:00:00.0, null]> but was:<[2022-06-15, null]>". On Oracle a Timestamp at the start of a day is now compared as the date it stands for.
…ForUnmappedForeignKey
testCycleOfNullableLogicalForeignKeys counts the DELETE statements of a
flush. Oracle batches statements by default, so both DELETEs were run as
one batch and counted once ("expected:<2> but was:<1>"). This test now
disables batching while it runs; the other tests of the class keep the
batch limit of the database.
…Free The profile used gvenzl/oracle-xe 18.4, which has no arm64 image, and the ojdbc8 19.3 driver. It now starts gvenzl/oracle-free:23-slim and tests with ojdbc11 23.26.4.0.0 from Maven Central. The init script did not take effect: it set processes=250 in the spfile without restarting the database, and the image now reads its init scripts from /container-entrypoint-initdb.d. It is replaced by a shell script that raises processes to 1000 and sessions to 1600 and restarts the database before the image reports it ready, so the test suite no longer runs out of connections (ORA-12516/ORA-12519). The EM Express port 5500 is no longer published, and the build matrix and TCK runner scripts stop the container by its new name. Usage: mvn -N -Ptest-oracle-docker docker:start mvn install -Ptest-oracle-docker mvn -N -Ptest-oracle-docker docker:stop
…oracle profile The test-oracle profile, for an Oracle database of your own, defaulted to com.oracle.ojdbc:ojdbc8:19.3.0.0 and documented installing a driver into a local repository by hand. It now defaults to com.oracle.database.jdbc:ojdbc11:23.26.4.0.0 from Maven Central, as the test-oracle-docker profile does. The unused oracle.maven.repo property is removed. Another driver can still be chosen with -Doracle.groupid, -Doracle.artifactid and -Doracle.version.
solomax
reviewed
Nov 6, 2026
solomax
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
COALESCE/CASE/NULLIF of
java.sql.Date/Timeare read withgetDate/getTime(ClassCastException on Oracle). Three tests fixed for Oracle.test-oracle-dockernow runs Oracle Free 23 with ojdbc11 and enough processes;test-oracleuses ojdbc11 from Maven Central.With all Oracle PRs combined: Oracle TCK 2131 pass / 0 errors; Oracle unit tests only fail in TestPessimisticLockException/TestTimeoutException (OPENJPA-3000).