You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by st...@apache.org on 2021/04/10 09:13:30 UTC

[openjpa] 02/02: Oracle seems to have changed their error handling.

This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit d6a19dd56a020d2991129584dcf221262bff28d1
Author: Mark Struberg <st...@apache.org>
AuthorDate: Sat Apr 10 11:11:21 2021 +0200

    Oracle seems to have changed their error handling.
    
    They now (tested with Oracle 18) behave more like other databases,
    so we should validate whether one of the described error situations got
    catched.
---
 .../persistence/batch/exception/TestBatchLimitException.java        | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java
index 26a2358..b129ac3 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java
@@ -355,6 +355,9 @@ public class TestBatchLimitException extends AbstractPersistenceTestCase {
             assertNotNull("Failed object was null.", failedObject);
             if (!isOracle && !isPostgres) {
                 assertEquals(expectedFailedObject, failedObject);
+            } else if (isOracle) {
+                // since Oracle 18 we see a different behaviour, so test both ways
+                assertTrue(failedObject.equals(expectedFailedObject) || failedObject.equals(expectedFailedObjectOracle) );
             } else {
                 // special case, as Oracle returns all statements in the batch
                 assertEquals(expectedFailedObjectOracle, failedObject);
@@ -370,6 +373,9 @@ public class TestBatchLimitException extends AbstractPersistenceTestCase {
         if (!isOracle && !isPostgres) {
             assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsg + "> but was " +
                 msg, msg.contains(expectedFailureMsg));
+        } else if (isOracle) {
+            // since Oracle 18 we see a different behaviour, so test both ways
+            assertTrue(msg.contains(expectedFailureMsg) || msg.contains(expectedFailureMsgOracle));
         } else {
             // special case, as Oracle returns all statements in the batch
             assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsgOracle + "> but was " +