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 2019/02/06 09:23:47 UTC

[openjpa] 02/03: hsqldb seems to have a bug with concurrent access to the underlying DB.

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 238449e155b9e70915b17a9f8f4cf6ef40e2bf9f
Author: Mark Struberg <st...@apache.org>
AuthorDate: Wed Feb 6 10:22:24 2019 +0100

    hsqldb seems to have a bug with concurrent access to the underlying DB.
---
 .../callbacks/TestMultiEmEntityListeners.java           | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMultiEmEntityListeners.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMultiEmEntityListeners.java
index c136cf4..4eab45a 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMultiEmEntityListeners.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMultiEmEntityListeners.java
@@ -18,20 +18,33 @@
  */
 package org.apache.openjpa.persistence.callbacks;
 
+import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
+import org.apache.openjpa.jdbc.sql.DBDictionary;
+import org.apache.openjpa.jdbc.sql.HSQLDictionary;
 import org.apache.openjpa.persistence.OpenJPAEntityManager;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 
 public class TestMultiEmEntityListeners extends SingleEMFTestCase {
+    private boolean skipped = false;
 
     @Override
     public void setUp() {
         setUp(CLEAR_TABLES, ListenerInEntity.class, AddListenerEntity.class
 //                , "openjpa.Compatibility", "SingletonLifecycleEventManager=true"
             );
+        DBDictionary dict = ((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance();
+        if (dict instanceof HSQLDictionary) {
+            getLog().warn("Skipping test " + getClass().getSimpleName() + " because of a known bug in the Database");
+            skipped = true;
+        }
     }
 
     public void testListenerInEntity1() {
+        if (skipped) {
+            return;
+        }
+
         OpenJPAEntityManager em1 = null;
         OpenJPAEntityManager em2 = null;
         try {
@@ -133,6 +146,10 @@ public class TestMultiEmEntityListeners extends SingleEMFTestCase {
     }
 
     public void testAddListenerEntity1() {
+        if (skipped) {
+            return;
+        }
+
         OpenJPAEntityManager em1 = null;
         OpenJPAEntityManager em2 = null;
         try {