You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/03/27 14:00:13 UTC

[1/2] activemq-artemis git commit: ARTEMIS-1757 Improve DB2 compatibility

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 5a3944656 -> caa19647a


ARTEMIS-1757 Improve DB2 compatibility

It includes:
- Fixed AUTO_INCREMENT not supported on DB2
- Added proper stop/teardown of driver
- Fixed recursive SQLException formatting


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/8842ac36
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/8842ac36
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/8842ac36

Branch: refs/heads/master
Commit: 8842ac3638d03692d72327b5adac91a1a15b9093
Parents: 5a39446
Author: Francesco Nigro <ni...@gmail.com>
Authored: Fri Feb 16 15:45:45 2018 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Mar 27 09:59:56 2018 -0400

----------------------------------------------------------------------
 .../activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java   | 1 +
 .../org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java | 2 +-
 artemis-jdbc-store/src/main/resources/journal-sql.properties      | 3 +++
 .../org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java  | 1 +
 .../tests/integration/largemessage/LargeMessageTestBase.java      | 2 +-
 .../tests/integration/persistence/StorageManagerTestBase.java     | 2 +-
 .../artemis/tests/integration/xa/BasicXaRecoveryTest.java         | 2 +-
 7 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8842ac36/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java
index fcbf90d..d34b31f 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java
@@ -95,6 +95,7 @@ public abstract class AbstractJDBCDriver {
       synchronized (connection) {
          if (sqlProvider.closeConnectionOnShutdown()) {
             try {
+               connection.setAutoCommit(true);
                connection.close();
             } catch (SQLException e) {
                logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8842ac36/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
index 2433938..bf57e9a 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
@@ -82,7 +82,7 @@ public class JDBCUtils {
             errorMessage.append(' ');
          }
          formatSqlException(errorMessage, nextEx);
-         nextEx = exception.getNextException();
+         nextEx = nextEx.getNextException();
          level++;
       }
       while (nextEx != null);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8842ac36/artemis-jdbc-store/src/main/resources/journal-sql.properties
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/resources/journal-sql.properties b/artemis-jdbc-store/src/main/resources/journal-sql.properties
index f659ad4..0e6398a 100644
--- a/artemis-jdbc-store/src/main/resources/journal-sql.properties
+++ b/artemis-jdbc-store/src/main/resources/journal-sql.properties
@@ -84,3 +84,6 @@ create-journal-table.oracle=CREATE TABLE %s(id NUMBER(19),recordType NUMBER(5),c
 # 4 GiB
 max-blob-size.oracle=4294967296
 table-names-case.oracle=upper
+
+# DB2 SQL statements
+create-file-table.db2=CREATE TABLE %s (ID BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1), FILENAME VARCHAR(255), EXTENSION VARCHAR(10), DATA BLOB, PRIMARY KEY(ID))
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8842ac36/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
index efaace4..63c8295 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
@@ -511,6 +511,7 @@ public abstract class ActiveMQTestBase extends Assert {
                connection.rollback();
             }
          }
+         connection.setAutoCommit(true);
       } catch (Throwable e) {
          e.printStackTrace();
       } finally {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8842ac36/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
index 1b27380..302c64a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java
@@ -83,7 +83,7 @@ public abstract class LargeMessageTestBase extends ActiveMQTestBase {
    public void tearDown() throws Exception {
       super.tearDown();
       if (storeType == StoreConfiguration.StoreType.DATABASE) {
-         destroyTables(Arrays.asList("BINDINGS", "LARGE_MESSAGE", "MESSAGE"));
+         destroyTables(Arrays.asList("BINDINGS", "LARGE_MESSAGE", "MESSAGE", "NODE_MANAGER_STORE"));
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8842ac36/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
index 6479d1e..26c637b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
@@ -111,7 +111,7 @@ public abstract class StorageManagerTestBase extends ActiveMQTestBase {
 
       scheduledExecutorService.shutdown();
 
-      destroyTables(Arrays.asList(new String[]{"MESSAGE", "BINDINGS", "LARGE_MESSAGE"}));
+      destroyTables(Arrays.asList(new String[]{"MESSAGE", "BINDINGS", "LARGE_MESSAGE", "NODE_MANAGER_STORE"}));
       super.tearDown();
       if (exception != null)
          throw exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8842ac36/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
index f5f83b5..1f17550 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java
@@ -123,7 +123,7 @@ public class BasicXaRecoveryTest extends ActiveMQTestBase {
       MBeanServerFactory.releaseMBeanServer(mbeanServer);
       super.tearDown();
       if (storeType == StoreConfiguration.StoreType.DATABASE) {
-         destroyTables(Arrays.asList("BINDINGS", "LARGE_MESSAGE", "MESSAGE"));
+         destroyTables(Arrays.asList("BINDINGS", "LARGE_MESSAGE", "MESSAGE", "NODE_MANAGER_STORE"));
       }
    }
 


[2/2] activemq-artemis git commit: This closes #1963

Posted by cl...@apache.org.
This closes #1963


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/caa19647
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/caa19647
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/caa19647

Branch: refs/heads/master
Commit: caa19647ae37ed9a1a45455c12a7b3e346a0376e
Parents: 5a39446 8842ac3
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Mar 27 09:59:57 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Mar 27 09:59:57 2018 -0400

----------------------------------------------------------------------
 .../activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java   | 1 +
 .../org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java | 2 +-
 artemis-jdbc-store/src/main/resources/journal-sql.properties      | 3 +++
 .../org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java  | 1 +
 .../tests/integration/largemessage/LargeMessageTestBase.java      | 2 +-
 .../tests/integration/persistence/StorageManagerTestBase.java     | 2 +-
 .../artemis/tests/integration/xa/BasicXaRecoveryTest.java         | 2 +-
 7 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------